devknife 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/LICENSE +21 -0
- package/README.md +217 -0
- package/dist/base64-CJAEMNK6.js +2 -0
- package/dist/base64-CJAEMNK6.js.map +1 -0
- package/dist/chunk-4LTWPAJW.js +2 -0
- package/dist/chunk-4LTWPAJW.js.map +1 -0
- package/dist/chunk-6UIJWUAN.js +2 -0
- package/dist/chunk-6UIJWUAN.js.map +1 -0
- package/dist/chunk-AYW5FKAL.js +2 -0
- package/dist/chunk-AYW5FKAL.js.map +1 -0
- package/dist/chunk-GTYGA6PU.js +2 -0
- package/dist/chunk-GTYGA6PU.js.map +1 -0
- package/dist/chunk-GZW2QEOC.js +2 -0
- package/dist/chunk-GZW2QEOC.js.map +1 -0
- package/dist/chunk-NW6U5UEX.js +2 -0
- package/dist/chunk-NW6U5UEX.js.map +1 -0
- package/dist/chunk-SDQ3PUQH.js +2 -0
- package/dist/chunk-SDQ3PUQH.js.map +1 -0
- package/dist/chunk-VPRHVS7Z.js +2 -0
- package/dist/chunk-VPRHVS7Z.js.map +1 -0
- package/dist/chunk-YBYCYSEC.js +2 -0
- package/dist/chunk-YBYCYSEC.js.map +1 -0
- package/dist/chunk-ZZLUWX3F.js +2 -0
- package/dist/chunk-ZZLUWX3F.js.map +1 -0
- package/dist/cli.cjs +1444 -0
- package/dist/cli.js +1421 -0
- package/dist/color-UNOPSQIT.js +2 -0
- package/dist/color-UNOPSQIT.js.map +1 -0
- package/dist/hash-52EWSWG4.js +2 -0
- package/dist/hash-52EWSWG4.js.map +1 -0
- package/dist/index.cjs +4 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +285 -0
- package/dist/index.d.ts +285 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/json-KEOS7PBI.js +2 -0
- package/dist/json-KEOS7PBI.js.map +1 -0
- package/dist/jwt-CKRHCFHP.js +2 -0
- package/dist/jwt-CKRHCFHP.js.map +1 -0
- package/dist/password-2Z5N7KS2.js +2 -0
- package/dist/password-2Z5N7KS2.js.map +1 -0
- package/dist/text-PAS3LRJD.js +2 -0
- package/dist/text-PAS3LRJD.js.map +1 -0
- package/dist/time-3XVRD5HD.js +2 -0
- package/dist/time-3XVRD5HD.js.map +1 -0
- package/dist/url-BRWDEVUS.js +2 -0
- package/dist/url-BRWDEVUS.js.map +1 -0
- package/dist/uuid-MZ4YSUFH.js +2 -0
- package/dist/uuid-MZ4YSUFH.js.map +1 -0
- package/package.json +86 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Secure password generator.
|
|
3
|
+
* Zero-dependency, uses only node:crypto for secure randomness.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
interface PasswordOptions {
|
|
7
|
+
length?: number;
|
|
8
|
+
uppercase?: boolean;
|
|
9
|
+
lowercase?: boolean;
|
|
10
|
+
numbers?: boolean;
|
|
11
|
+
symbols?: boolean;
|
|
12
|
+
excludeAmbiguous?: boolean;
|
|
13
|
+
}
|
|
14
|
+
declare function generatePassword(options?: PasswordOptions): string;
|
|
15
|
+
declare function calculateEntropy(password: string): number;
|
|
16
|
+
declare function estimateStrength(password: string): 'weak' | 'fair' | 'strong' | 'very-strong';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Hash generators: MD5, SHA-1, SHA-256, SHA-512
|
|
20
|
+
* Zero-dependency, uses only node:crypto
|
|
21
|
+
*/
|
|
22
|
+
type HashAlgorithm = 'md5' | 'sha1' | 'sha256' | 'sha512';
|
|
23
|
+
declare function md5(input: string): string;
|
|
24
|
+
declare function sha1(input: string): string;
|
|
25
|
+
declare function sha256(input: string): string;
|
|
26
|
+
declare function sha512(input: string): string;
|
|
27
|
+
declare function isSupportedAlgorithm(algo: string): algo is HashAlgorithm;
|
|
28
|
+
declare function getSupportedAlgorithms(): readonly HashAlgorithm[];
|
|
29
|
+
declare function hashFile(content: string | Buffer, algorithm?: HashAlgorithm): string;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* UUID v4 generator.
|
|
33
|
+
* Zero-dependency, uses node:crypto for secure randomness.
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
declare function generateUUID(): string;
|
|
37
|
+
declare function isValidUUID(id: string): boolean;
|
|
38
|
+
declare function generateUUIDs(count: number): string[];
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Zero-dependency NanoID-like generator.
|
|
42
|
+
* Uses node:crypto for secure randomness.
|
|
43
|
+
*/
|
|
44
|
+
interface NanoIDOptions {
|
|
45
|
+
size?: number;
|
|
46
|
+
alphabet?: string;
|
|
47
|
+
}
|
|
48
|
+
declare function generateNanoID(options?: NanoIDOptions): string;
|
|
49
|
+
declare function isNanoIDValid(id: string, options?: NanoIDOptions): boolean;
|
|
50
|
+
declare function generateNanoIDs(count: number, options?: NanoIDOptions): string[];
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Lorem Ipsum text generator.
|
|
54
|
+
* Zero-dependency.
|
|
55
|
+
*/
|
|
56
|
+
declare function word(count?: number): string;
|
|
57
|
+
declare function sentence(wordCount?: number): string;
|
|
58
|
+
declare function paragraph(sentenceCount?: number): string;
|
|
59
|
+
declare function paragraphs(count?: number, separator?: string): string;
|
|
60
|
+
declare function title(wordCount?: number): string;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Base64 encode/decode.
|
|
64
|
+
* Zero-dependency, uses Node Buffer.
|
|
65
|
+
*/
|
|
66
|
+
declare function encode$2(input: string): string;
|
|
67
|
+
declare function decode$3(input: string): string;
|
|
68
|
+
declare function isBase64(str: string): boolean;
|
|
69
|
+
declare function encodeURLSafe(input: string): string;
|
|
70
|
+
declare function decodeURLSafe(input: string): string;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* URL encode/decode.
|
|
74
|
+
* Zero-dependency, uses Node built-in encodeURIComponent/decodeURIComponent.
|
|
75
|
+
*/
|
|
76
|
+
declare function encode$1(input: string): string;
|
|
77
|
+
declare function decode$2(input: string): string;
|
|
78
|
+
declare function encodeComponent(input: string): string;
|
|
79
|
+
declare function decodeComponent(input: string): string;
|
|
80
|
+
declare function isValidEncoded(str: string): boolean;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* HTML entity encode/decode.
|
|
84
|
+
* Zero-dependency.
|
|
85
|
+
*/
|
|
86
|
+
declare function encode(input: string): string;
|
|
87
|
+
declare function decode$1(input: string): string;
|
|
88
|
+
declare function encodeAttribute(input: string): string;
|
|
89
|
+
declare function stripTags(input: string): string;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* JWT decoder (header/payload parsing).
|
|
93
|
+
* Zero-dependency, uses Node Buffer.
|
|
94
|
+
*/
|
|
95
|
+
interface JWTHeader {
|
|
96
|
+
alg?: string;
|
|
97
|
+
typ?: string;
|
|
98
|
+
[key: string]: unknown;
|
|
99
|
+
}
|
|
100
|
+
interface JWTPayload {
|
|
101
|
+
sub?: string;
|
|
102
|
+
iss?: string;
|
|
103
|
+
aud?: string | string[];
|
|
104
|
+
exp?: number;
|
|
105
|
+
nbf?: number;
|
|
106
|
+
iat?: number;
|
|
107
|
+
jti?: string;
|
|
108
|
+
[key: string]: unknown;
|
|
109
|
+
}
|
|
110
|
+
interface JWTDecodeResult {
|
|
111
|
+
header: JWTHeader;
|
|
112
|
+
payload: JWTPayload;
|
|
113
|
+
signature: string;
|
|
114
|
+
}
|
|
115
|
+
interface JWTExpired {
|
|
116
|
+
expired: boolean;
|
|
117
|
+
expiresAt: Date | null;
|
|
118
|
+
}
|
|
119
|
+
declare function decode(token: string): JWTDecodeResult;
|
|
120
|
+
declare function isExpired(token: string): JWTExpired;
|
|
121
|
+
declare function isValidJWT(token: string): boolean;
|
|
122
|
+
declare function getIssuer(token: string): string | null;
|
|
123
|
+
declare function getSubject(token: string): string | null;
|
|
124
|
+
declare function getExpiration(token: string): Date | null;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* JSON prettify / minify.
|
|
128
|
+
* Zero-dependency.
|
|
129
|
+
*/
|
|
130
|
+
declare function format(input: string, indent?: number): string;
|
|
131
|
+
declare function minify(input: string): string;
|
|
132
|
+
declare function validate(input: string): {
|
|
133
|
+
valid: boolean;
|
|
134
|
+
error?: string;
|
|
135
|
+
data?: unknown;
|
|
136
|
+
};
|
|
137
|
+
declare function sortByKeys(input: string, indent?: number): string;
|
|
138
|
+
declare function flatten(input: string): string;
|
|
139
|
+
declare function prettyStringify(obj: unknown, indent?: number): string;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* String case converter.
|
|
143
|
+
* Zero-dependency.
|
|
144
|
+
*/
|
|
145
|
+
declare function camelCase(input: string): string;
|
|
146
|
+
declare function snakeCase(input: string): string;
|
|
147
|
+
declare function kebabCase(input: string): string;
|
|
148
|
+
declare function pascalCase(input: string): string;
|
|
149
|
+
declare function constantCase(input: string): string;
|
|
150
|
+
declare function dotCase(input: string): string;
|
|
151
|
+
declare function titleCase(input: string): string;
|
|
152
|
+
declare function sentenceCase(input: string): string;
|
|
153
|
+
declare function upperCase(input: string): string;
|
|
154
|
+
declare function lowerCase(input: string): string;
|
|
155
|
+
declare function reverseCase(input: string): string;
|
|
156
|
+
declare function slugify(input: string): string;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Color conversions: HEX <-> RGB <-> HSL.
|
|
160
|
+
* Zero-dependency.
|
|
161
|
+
*/
|
|
162
|
+
interface RGB {
|
|
163
|
+
r: number;
|
|
164
|
+
g: number;
|
|
165
|
+
b: number;
|
|
166
|
+
}
|
|
167
|
+
interface HSL {
|
|
168
|
+
h: number;
|
|
169
|
+
s: number;
|
|
170
|
+
l: number;
|
|
171
|
+
}
|
|
172
|
+
declare function hexToRgb(hex: string): RGB;
|
|
173
|
+
declare function rgbToHex(r: number, g: number, b: number): string;
|
|
174
|
+
declare function rgbToHsl(r: number, g: number, b: number): HSL;
|
|
175
|
+
declare function hslToRgb(h: number, s: number, l: number): RGB;
|
|
176
|
+
declare function hexToHsl(hex: string): HSL;
|
|
177
|
+
declare function hslToHex(h: number, s: number, l: number): string;
|
|
178
|
+
declare function isValidHex(hex: string): boolean;
|
|
179
|
+
declare function isLightColor(hex: string): boolean;
|
|
180
|
+
declare function rgbToCSS(r: number, g: number, b: number): string;
|
|
181
|
+
declare function hslToCSS(h: number, s: number, l: number): string;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Time conversions: Epoch <-> ISO <-> relative.
|
|
185
|
+
* Zero-dependency.
|
|
186
|
+
*/
|
|
187
|
+
declare function epochToIso(epoch: number): string;
|
|
188
|
+
declare function isoToEpoch(iso: string): number;
|
|
189
|
+
declare function epochToLocale(epoch: number, timezone?: string): string;
|
|
190
|
+
declare function nowEpoch(): number;
|
|
191
|
+
declare function nowIso(): string;
|
|
192
|
+
declare function msToSeconds(ms: number): number;
|
|
193
|
+
declare function secondsToMs(seconds: number): number;
|
|
194
|
+
declare function timeAgo(epoch: number): string;
|
|
195
|
+
declare function isValidIsoDate(str: string): boolean;
|
|
196
|
+
declare function getDaysBetween(date1: string, date2: string): number;
|
|
197
|
+
declare function formatDate(iso: string, format: string): string;
|
|
198
|
+
declare function getWeekNumber(iso: string): number;
|
|
199
|
+
declare function isLeapYear(year: number): boolean;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Number base conversions: Binary/Hex/Octal/Decimal.
|
|
203
|
+
* Zero-dependency.
|
|
204
|
+
*/
|
|
205
|
+
declare function decimalToBinary(decimal: number): string;
|
|
206
|
+
declare function binaryToDecimal(binary: string): number;
|
|
207
|
+
declare function decimalToHex(decimal: number): string;
|
|
208
|
+
declare function hexToDecimal(hex: string): number;
|
|
209
|
+
declare function decimalToOctal(decimal: number): number;
|
|
210
|
+
declare function octalToDecimal(octal: string): number;
|
|
211
|
+
declare function hexToBinary(hex: string): string;
|
|
212
|
+
declare function binaryToHex(binary: string): string;
|
|
213
|
+
declare function toBase(num: number, base: number): string;
|
|
214
|
+
declare function fromBase(str: string, base: number): number;
|
|
215
|
+
declare function isBinary(str: string): boolean;
|
|
216
|
+
declare function isHex(str: string): boolean;
|
|
217
|
+
declare function isOctal(str: string): boolean;
|
|
218
|
+
declare function formatBytes(bytes: number, decimals?: number): string;
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* IP address utilities.
|
|
222
|
+
* Zero-dependency for validation; os module for local IPs.
|
|
223
|
+
*/
|
|
224
|
+
declare function isValidIPv4(ip: string): boolean;
|
|
225
|
+
declare function isValidIPv6(ip: string): boolean;
|
|
226
|
+
declare function isValidIP(ip: string): boolean;
|
|
227
|
+
declare function getLocalIPs(): string[];
|
|
228
|
+
declare function getLocalIPv4(): string | null;
|
|
229
|
+
declare function isPrivateIP(ip: string): boolean;
|
|
230
|
+
declare function isReservedIP(ip: string): boolean;
|
|
231
|
+
declare function getHostname(): string;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* MAC address generator and validator.
|
|
235
|
+
* Zero-dependency.
|
|
236
|
+
*/
|
|
237
|
+
|
|
238
|
+
declare function isValidMAC(mac: string): boolean;
|
|
239
|
+
declare function generateMAC(separator?: string): string;
|
|
240
|
+
declare function normalizeMAC(mac: string, separator?: string): string;
|
|
241
|
+
declare function macToHex(mac: string): string;
|
|
242
|
+
|
|
243
|
+
declare const hash: {
|
|
244
|
+
md5: (input: string) => Promise<string>;
|
|
245
|
+
sha1: (input: string) => Promise<string>;
|
|
246
|
+
sha256: (input: string) => Promise<string>;
|
|
247
|
+
sha512: (input: string) => Promise<string>;
|
|
248
|
+
};
|
|
249
|
+
declare const uuid: {
|
|
250
|
+
v4: () => Promise<string>;
|
|
251
|
+
};
|
|
252
|
+
declare const password: {
|
|
253
|
+
generate: (options?: PasswordOptions) => Promise<string>;
|
|
254
|
+
};
|
|
255
|
+
declare const base64: {
|
|
256
|
+
encode: (input: string) => Promise<string>;
|
|
257
|
+
decode: (input: string) => Promise<string>;
|
|
258
|
+
};
|
|
259
|
+
declare const url: {
|
|
260
|
+
encode: (input: string) => Promise<string>;
|
|
261
|
+
decode: (input: string) => Promise<string>;
|
|
262
|
+
};
|
|
263
|
+
declare const jwt: {
|
|
264
|
+
decode: (token: string) => Promise<JWTDecodeResult>;
|
|
265
|
+
};
|
|
266
|
+
declare const json: {
|
|
267
|
+
format: (input: string) => Promise<string>;
|
|
268
|
+
minify: (input: string) => Promise<string>;
|
|
269
|
+
};
|
|
270
|
+
declare const text: {
|
|
271
|
+
camelCase: (input: string) => Promise<string>;
|
|
272
|
+
snakeCase: (input: string) => Promise<string>;
|
|
273
|
+
kebabCase: (input: string) => Promise<string>;
|
|
274
|
+
pascalCase: (input: string) => Promise<string>;
|
|
275
|
+
};
|
|
276
|
+
declare const color: {
|
|
277
|
+
hexToRgb: (hex: string) => Promise<RGB>;
|
|
278
|
+
rgbToHex: (r: number, g: number, b: number) => Promise<string>;
|
|
279
|
+
};
|
|
280
|
+
declare const time: {
|
|
281
|
+
epochToIso: (epoch: number) => Promise<string>;
|
|
282
|
+
isoToEpoch: (iso: string) => Promise<number>;
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
export { type HSL, type HashAlgorithm, type JWTDecodeResult, type JWTExpired, type JWTHeader, type JWTPayload, type NanoIDOptions, type PasswordOptions, type RGB, base64, decode$3 as base64Decode, decodeURLSafe as base64DecodeURLSafe, encode$2 as base64Encode, encodeURLSafe as base64EncodeURLSafe, binaryToDecimal, binaryToHex, calculateEntropy, camelCase, color, constantCase, decimalToBinary, decimalToHex, decimalToOctal, dotCase, epochToIso, epochToLocale, estimateStrength, formatBytes, formatDate, fromBase, generateMAC, generateNanoID, generateNanoIDs, generatePassword, generateUUID, generateUUIDs, getDaysBetween, getHostname, getLocalIPs, getLocalIPv4, getSupportedAlgorithms, getWeekNumber, hash, hashFile, hexToBinary, hexToDecimal, hexToHsl, hexToRgb, hslToCSS, hslToHex, hslToRgb, decode$1 as htmlDecode, encode as htmlEncode, encodeAttribute as htmlEncodeAttribute, isBase64, isBinary, isHex, isLeapYear, isLightColor, isNanoIDValid, isOctal, isPrivateIP, isReservedIP, isSupportedAlgorithm, isValidEncoded, isValidHex, isValidIP, isValidIPv4, isValidIPv6, isValidIsoDate, isValidJWT, isValidMAC, isValidUUID, isoToEpoch, json, flatten as jsonFlatten, format as jsonFormat, minify as jsonMinify, sortByKeys as jsonSortByKeys, validate as jsonValidate, jwt, decode as jwtDecode, getExpiration as jwtGetExpiration, getIssuer as jwtGetIssuer, getSubject as jwtGetSubject, isExpired as jwtIsExpired, kebabCase, paragraph as loremParagraph, paragraphs as loremParagraphs, sentence as loremSentence, title as loremTitle, word as loremWord, lowerCase, macToHex, md5, msToSeconds, normalizeMAC, nowEpoch, nowIso, octalToDecimal, pascalCase, password, prettyStringify, reverseCase, rgbToCSS, rgbToHex, rgbToHsl, secondsToMs, sentenceCase, sha1, sha256, sha512, slugify, snakeCase, stripTags, text, time, timeAgo, titleCase, toBase, upperCase, url, decode$2 as urlDecode, decodeComponent as urlDecodeComponent, encode$1 as urlEncode, encodeComponent as urlEncodeComponent, uuid };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{a as ne,b as oe,c as se,d as ie,e as ae,f as ce,g as pe,h as ue,i as le,j as me,k as ge,l as de}from"./chunk-ZZLUWX3F.js";import{a as fe,b as he,c as xe,d as be,e as Ie,f as we,g as Te,h as Ee,i as ye,j as Ce}from"./chunk-AYW5FKAL.js";import{a as De,b as Be,c as Ae,d as ve,e as Pe,f as Se,g as je,h as Me,i as Re,j as He,k as Ne,l as Ue,m as Le}from"./chunk-6UIJWUAN.js";import{b as E,c as y,d as C,e as D,f as B,g as A,h as v}from"./chunk-4LTWPAJW.js";import{b as P,c as S,d as j}from"./chunk-NW6U5UEX.js";import{b as M,c as R,d as H}from"./chunk-GTYGA6PU.js";import{a as N,b as U,c as L,d as V,e as F}from"./chunk-YBYCYSEC.js";import{a as O,b as q,c as $,d as k,e as z}from"./chunk-VPRHVS7Z.js";import{a as G,b as _,c as W,d as J,e as X,f as Y}from"./chunk-GZW2QEOC.js";import{a as K,b as Z,c as Q,d as ee,e as te,f as re}from"./chunk-SDQ3PUQH.js";import{webcrypto as Ve}from"crypto";var c="-_0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",p=21;function Fe(e){let t=new Uint32Array(1);return Ve.getRandomValues(t),t[0]%e}function u(e={}){let t=e.size??p,r=e.alphabet??c;if(r.length===0)throw new Error("Alphabet must not be empty");let n="";for(let o=0;o<t;o++)n+=r[Fe(r.length)];return n}function Oe(e,t={}){let r=t.size??p,n=t.alphabet??c;return e.length!==r?!1:e.split("").every(o=>n.includes(o))}function qe(e,t={}){if(e<1)throw new Error("Count must be at least 1");return Array.from({length:e},()=>u(t))}var l=["lorem","ipsum","dolor","sit","amet","consectetur","adipiscing","elit","sed","do","eiusmod","tempor","incididunt","ut","labore","et","dolore","magna","aliqua","enim","ad","minim","veniam","quis","nostrud","exercitation","ullamco","laboris","nisi","aliquip","ex","ea","commodo","consequat","duis","aute","irure","in","reprehenderit","voluptate","velit","esse","cillum","fugiat","nulla","pariatur","excepteur","sint","occaecat","cupidatat","non","proident","sunt","culpa","qui","officia","deserunt","mollit","anim","id","est","laborum","perspiciatis","unde","omnis","iste","natus","error","voluptatem","accusantium","doloremque","laudantium","totam","rem","aperiam","eaque","ipsa","quae","ab","illo","inventore","veritatis","quasi","architecto","beatae","vitae","dicta","explicabo","nemo","ipsam","voluptas","aspernatur","aut","odit","fugit","consequuntur","magni","dolores","eos","ratione","sequi","nesciunt"];function $e(e){return Math.floor(Math.random()*e)}function m(e){return e.charAt(0).toUpperCase()+e.slice(1)}function a(e=1){let t=[];for(let r=0;r<e;r++)t.push(l[$e(l.length)]);return t.join(" ")}function g(e){let t=e??8+Math.floor(Math.random()*8),r=a(t);return m(r)+"."}function d(e){let t=e??4+Math.floor(Math.random()*4),r=[];for(let n=0;n<t;n++)r.push(g());return r.join(" ")}function ke(e=1,t=`
|
|
2
|
+
|
|
3
|
+
`){let r=[];for(let n=0;n<e;n++)r.push(d());return r.join(t)}function ze(e){let t=e??3+Math.floor(Math.random()*4);return a(t).split(" ").map(n=>m(n)).join(" ")}var Ge={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="},_e={"&":"&","<":"<",">":">",""":'"',"'":"'","'":"'","/":"/","`":"`","=":"=","'":"'"},We=/[&<>"'`=/]/g,Je=/&(?:amp|lt|gt|quot|#39|#x27|#x2F|#x60|#x3D|apos);/g;function Xe(e){return e.replace(We,t=>Ge[t])}function Ye(e){return e.replace(Je,t=>_e[t])}function Ke(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function Ze(e){return e.replace(/<[^>]*>/g,"")}function f(e){if(!Number.isInteger(e))throw new Error("Input must be an integer");return e.toString(2)}function h(e){if(!/^[01]+$/.test(e))throw new Error("Invalid binary string");return parseInt(e,2)}function x(e){if(!Number.isInteger(e))throw new Error("Input must be an integer");return e.toString(16)}function b(e){if(!/^[0-9a-fA-F]+$/.test(e))throw new Error("Invalid hexadecimal string");return parseInt(e,16)}function Qe(e){if(!Number.isInteger(e))throw new Error("Input must be an integer");return parseInt(e.toString(8),10)}function et(e){if(!/^[0-7]+$/.test(e))throw new Error("Invalid octal string");return parseInt(e,8)}function tt(e){let t=b(e);return f(t)}function rt(e){let t=h(e);return x(t)}function nt(e,t){if(t<2||t>36)throw new Error("Base must be between 2 and 36");if(!Number.isInteger(e))throw new Error("Input must be an integer");return e.toString(t)}function ot(e,t){if(t<2||t>36)throw new Error("Base must be between 2 and 36");return parseInt(e,t)}function st(e){return/^[01]+$/.test(e)}function it(e){return/^[0-9a-fA-F]+$/.test(e)}function at(e){return/^[0-7]+$/.test(e)}function ct(e,t=2){if(e===0)return"0 Bytes";if(e<0)throw new Error("Bytes cannot be negative");let r=1024,n=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],o=Math.min(Math.floor(Math.log(e)/Math.log(r)),n.length-1),T=n[o];return`${parseFloat((e/Math.pow(r,o)).toFixed(t))} ${T}`}import*as s from"os";var pt=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/;function i(e){return pt.test(e)}var ut=/^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/;function I(e){if(e.includes("::")){let t=e.split("::");if(t.length!==2)return!1;let r=t[0].split(":").filter(Boolean),n=t[1].split(":").filter(Boolean);return r.length+n.length<=7&&r.length+n.length>=1}return ut.test(e)}function lt(e){return i(e)||I(e)}function w(){let e=s.networkInterfaces(),t=[];for(let r of Object.keys(e)){let n=e[r];if(n!==void 0)for(let o of n)o.family==="IPv4"&&!o.internal&&t.push(o.address)}return t}function mt(){return w()[0]??null}function gt(e){if(!i(e))return!1;let t=e.split(".").map(Number);return t[0]===10||t[0]===172&&t[1]>=16&&t[1]<=31||t[0]===192&&t[1]===168||t[0]===127}function dt(e){if(!i(e))return!1;let t=e.split(".").map(Number);return t[0]===0||t[0]===127||t[0]===169&&t[1]===254||t[0]>=224}function ft(){return s.hostname()}import{randomBytes as ht}from"crypto";var xt=/^([0-9A-Fa-f]{2}[:-]){5}[0-9A-Fa-f]{2}$/;function bt(e){return xt.test(e)}function It(e=":"){let t=Array.from(ht(6),r=>r.toString(16).padStart(2,"0").toUpperCase());return t[0]=(parseInt(t[0],16)&254|2).toString(16).padStart(2,"0").toUpperCase(),t.join(e)}function wt(e,t=":"){let r=e.replace(/[-:]/g,"").toUpperCase();if(r.length!==12)throw new Error("Invalid MAC address length");return r.match(/.{2}/g).join(t)}function Tt(e){let t=e.replace(/[-:]/g,"").toLowerCase();if(t.length!==12)throw new Error("Invalid MAC address");return`0x${t}`}var Jt={md5:e=>import("./hash-52EWSWG4.js").then(t=>t.md5(e)),sha1:e=>import("./hash-52EWSWG4.js").then(t=>t.sha1(e)),sha256:e=>import("./hash-52EWSWG4.js").then(t=>t.sha256(e)),sha512:e=>import("./hash-52EWSWG4.js").then(t=>t.sha512(e))},Xt={v4:()=>import("./uuid-MZ4YSUFH.js").then(e=>e.generateUUID())},Yt={generate:e=>import("./password-2Z5N7KS2.js").then(t=>t.generatePassword(e))},Kt={encode:e=>import("./base64-CJAEMNK6.js").then(t=>t.encode(e)),decode:e=>import("./base64-CJAEMNK6.js").then(t=>t.decode(e))},Zt={encode:e=>import("./url-BRWDEVUS.js").then(t=>t.encode(e)),decode:e=>import("./url-BRWDEVUS.js").then(t=>t.decode(e))},Qt={decode:e=>import("./jwt-CKRHCFHP.js").then(t=>t.decode(e))},er={format:e=>import("./json-KEOS7PBI.js").then(t=>t.format(e)),minify:e=>import("./json-KEOS7PBI.js").then(t=>t.minify(e))},tr={camelCase:e=>import("./text-PAS3LRJD.js").then(t=>t.camelCase(e)),snakeCase:e=>import("./text-PAS3LRJD.js").then(t=>t.snakeCase(e)),kebabCase:e=>import("./text-PAS3LRJD.js").then(t=>t.kebabCase(e)),pascalCase:e=>import("./text-PAS3LRJD.js").then(t=>t.pascalCase(e))},rr={hexToRgb:e=>import("./color-UNOPSQIT.js").then(t=>t.hexToRgb(e)),rgbToHex:(e,t,r)=>import("./color-UNOPSQIT.js").then(n=>n.rgbToHex(e,t,r))},nr={epochToIso:e=>import("./time-3XVRD5HD.js").then(t=>t.epochToIso(e)),isoToEpoch:e=>import("./time-3XVRD5HD.js").then(t=>t.isoToEpoch(e))};export{Kt as base64,U as base64Decode,F as base64DecodeURLSafe,N as base64Encode,V as base64EncodeURLSafe,h as binaryToDecimal,rt as binaryToHex,S as calculateEntropy,ne as camelCase,rr as color,ae as constantCase,f as decimalToBinary,x as decimalToHex,Qe as decimalToOctal,ce as dotCase,De as epochToIso,Ae as epochToLocale,j as estimateStrength,ct as formatBytes,Ne as formatDate,ot as fromBase,It as generateMAC,u as generateNanoID,qe as generateNanoIDs,P as generatePassword,M as generateUUID,H as generateUUIDs,He as getDaysBetween,ft as getHostname,w as getLocalIPs,mt as getLocalIPv4,A as getSupportedAlgorithms,Ue as getWeekNumber,Jt as hash,v as hashFile,tt as hexToBinary,b as hexToDecimal,Ie as hexToHsl,fe as hexToRgb,Ce as hslToCSS,we as hslToHex,be as hslToRgb,Ye as htmlDecode,Xe as htmlEncode,Ke as htmlEncodeAttribute,L as isBase64,st as isBinary,it as isHex,Le as isLeapYear,Ee as isLightColor,Oe as isNanoIDValid,at as isOctal,gt as isPrivateIP,dt as isReservedIP,B as isSupportedAlgorithm,z as isValidEncoded,Te as isValidHex,lt as isValidIP,i as isValidIPv4,I as isValidIPv6,Re as isValidIsoDate,W as isValidJWT,bt as isValidMAC,R as isValidUUID,Be as isoToEpoch,er as json,te as jsonFlatten,K as jsonFormat,Z as jsonMinify,ee as jsonSortByKeys,Q as jsonValidate,Qt as jwt,G as jwtDecode,Y as jwtGetExpiration,J as jwtGetIssuer,X as jwtGetSubject,_ as jwtIsExpired,se as kebabCase,d as loremParagraph,ke as loremParagraphs,g as loremSentence,ze as loremTitle,a as loremWord,me as lowerCase,Tt as macToHex,E as md5,Se as msToSeconds,wt as normalizeMAC,ve as nowEpoch,Pe as nowIso,et as octalToDecimal,ie as pascalCase,Yt as password,re as prettyStringify,ge as reverseCase,ye as rgbToCSS,he as rgbToHex,xe as rgbToHsl,je as secondsToMs,ue as sentenceCase,y as sha1,C as sha256,D as sha512,de as slugify,oe as snakeCase,Ze as stripTags,tr as text,nr as time,Me as timeAgo,pe as titleCase,nt as toBase,le as upperCase,Zt as url,q as urlDecode,k as urlDecodeComponent,O as urlEncode,$ as urlEncodeComponent,Xt as uuid};
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tools/generators/nanoid.ts","../src/tools/generators/lorem.ts","../src/tools/encoders/html.ts","../src/tools/converters/number.ts","../src/tools/network/ip.ts","../src/tools/network/mac.ts","../src/index.ts"],"sourcesContent":["/**\n * Zero-dependency NanoID-like generator.\n * Uses node:crypto for secure randomness.\n */\n\nimport { webcrypto } from 'node:crypto';\n\nconst DEFAULT_ALPHABET = '-_0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\nconst DEFAULT_SIZE = 21;\n\nfunction secureRandom(max: number): number {\n const array = new Uint32Array(1);\n webcrypto.getRandomValues(array);\n return array[0]! % max;\n}\n\nexport interface NanoIDOptions {\n size?: number;\n alphabet?: string;\n}\n\nexport function generateNanoID(options: NanoIDOptions = {}): string {\n const size = options.size ?? DEFAULT_SIZE;\n const alphabet = options.alphabet ?? DEFAULT_ALPHABET;\n\n if (alphabet.length === 0) {\n throw new Error('Alphabet must not be empty');\n }\n\n let id = '';\n for (let i = 0; i < size; i++) {\n id += alphabet[secureRandom(alphabet.length)]!;\n }\n return id;\n}\n\nexport function isNanoIDValid(id: string, options: NanoIDOptions = {}): boolean {\n const size = options.size ?? DEFAULT_SIZE;\n const alphabet = options.alphabet ?? DEFAULT_ALPHABET;\n if (id.length !== size) return false;\n return id.split('').every((c) => alphabet.includes(c));\n}\n\nexport function generateNanoIDs(count: number, options: NanoIDOptions = {}): string[] {\n if (count < 1) throw new Error('Count must be at least 1');\n return Array.from({ length: count }, () => generateNanoID(options));\n}\n","/**\n * Lorem Ipsum text generator.\n * Zero-dependency.\n */\n\nconst LOREM_WORDS = [\n 'lorem', 'ipsum', 'dolor', 'sit', 'amet', 'consectetur', 'adipiscing', 'elit',\n 'sed', 'do', 'eiusmod', 'tempor', 'incididunt', 'ut', 'labore', 'et', 'dolore',\n 'magna', 'aliqua', 'enim', 'ad', 'minim', 'veniam', 'quis', 'nostrud',\n 'exercitation', 'ullamco', 'laboris', 'nisi', 'aliquip', 'ex', 'ea', 'commodo',\n 'consequat', 'duis', 'aute', 'irure', 'in', 'reprehenderit', 'voluptate',\n 'velit', 'esse', 'cillum', 'fugiat', 'nulla', 'pariatur', 'excepteur', 'sint',\n 'occaecat', 'cupidatat', 'non', 'proident', 'sunt', 'culpa', 'qui', 'officia',\n 'deserunt', 'mollit', 'anim', 'id', 'est', 'laborum', 'perspiciatis', 'unde',\n 'omnis', 'iste', 'natus', 'error', 'voluptatem', 'accusantium', 'doloremque',\n 'laudantium', 'totam', 'rem', 'aperiam', 'eaque', 'ipsa', 'quae', 'ab', 'illo',\n 'inventore', 'veritatis', 'quasi', 'architecto', 'beatae', 'vitae', 'dicta',\n 'explicabo', 'nemo', 'ipsam', 'voluptas', 'aspernatur', 'aut', 'odit',\n 'fugit', 'consequuntur', 'magni', 'dolores', 'eos', 'ratione', 'sequi', 'nesciunt',\n];\n\nfunction randomIndex(max: number): number {\n return Math.floor(Math.random() * max);\n}\n\nfunction capitalize(str: string): string {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n\nexport function word(count: number = 1): string {\n const words: string[] = [];\n for (let i = 0; i < count; i++) {\n words.push(LOREM_WORDS[randomIndex(LOREM_WORDS.length)]!);\n }\n return words.join(' ');\n}\n\nexport function sentence(wordCount?: number): string {\n const count = wordCount ?? (8 + Math.floor(Math.random() * 8));\n const words = word(count);\n return capitalize(words) + '.';\n}\n\nexport function paragraph(sentenceCount?: number): string {\n const count = sentenceCount ?? (4 + Math.floor(Math.random() * 4));\n const sentences: string[] = [];\n for (let i = 0; i < count; i++) {\n sentences.push(sentence());\n }\n return sentences.join(' ');\n}\n\nexport function paragraphs(count: number = 1, separator: string = '\\n\\n'): string {\n const result: string[] = [];\n for (let i = 0; i < count; i++) {\n result.push(paragraph());\n }\n return result.join(separator);\n}\n\nexport function title(wordCount?: number): string {\n const count = wordCount ?? (3 + Math.floor(Math.random() * 4));\n const words = word(count);\n return words\n .split(' ')\n .map((w) => capitalize(w))\n .join(' ');\n}\n","/**\n * HTML entity encode/decode.\n * Zero-dependency.\n */\n\nconst ENTITY_MAP: Record<string, string> = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '/': '/',\n '`': '`',\n '=': '=',\n};\n\nconst DECODE_MAP: Record<string, string> = {\n '&': '&',\n '<': '<',\n '>': '>',\n '"': '\"',\n ''': \"'\",\n ''': \"'\",\n '/': '/',\n '`': '`',\n '=': '=',\n ''': \"'\",\n};\n\nconst ENTITY_REGEX = /[&<>\"'`=/]/g;\nconst DECODE_REGEX = /&(?:amp|lt|gt|quot|#39|#x27|#x2F|#x60|#x3D|apos);/g;\n\nexport function encode(input: string): string {\n return input.replace(ENTITY_REGEX, (char) => ENTITY_MAP[char] as string);\n}\n\nexport function decode(input: string): string {\n return input.replace(DECODE_REGEX, (entity) => DECODE_MAP[entity] as string);\n}\n\nexport function encodeAttribute(input: string): string {\n return input\n .replace(/&/g, '&')\n .replace(/\"/g, '"')\n .replace(/'/g, ''')\n .replace(/</g, '<')\n .replace(/>/g, '>');\n}\n\nexport function stripTags(input: string): string {\n return input.replace(/<[^>]*>/g, '');\n}\n","/**\n * Number base conversions: Binary/Hex/Octal/Decimal.\n * Zero-dependency.\n */\n\nexport function decimalToBinary(decimal: number): string {\n if (!Number.isInteger(decimal)) throw new Error('Input must be an integer');\n return decimal.toString(2);\n}\n\nexport function binaryToDecimal(binary: string): number {\n if (!/^[01]+$/.test(binary)) throw new Error('Invalid binary string');\n return parseInt(binary, 2);\n}\n\nexport function decimalToHex(decimal: number): string {\n if (!Number.isInteger(decimal)) throw new Error('Input must be an integer');\n return decimal.toString(16);\n}\n\nexport function hexToDecimal(hex: string): number {\n if (!/^[0-9a-fA-F]+$/.test(hex)) throw new Error('Invalid hexadecimal string');\n return parseInt(hex, 16);\n}\n\nexport function decimalToOctal(decimal: number): number {\n if (!Number.isInteger(decimal)) throw new Error('Input must be an integer');\n return parseInt(decimal.toString(8), 10);\n}\n\nexport function octalToDecimal(octal: string): number {\n if (!/^[0-7]+$/.test(octal)) throw new Error('Invalid octal string');\n return parseInt(octal, 8);\n}\n\nexport function hexToBinary(hex: string): string {\n const decimal = hexToDecimal(hex);\n return decimalToBinary(decimal);\n}\n\nexport function binaryToHex(binary: string): string {\n const decimal = binaryToDecimal(binary);\n return decimalToHex(decimal);\n}\n\nexport function toBase(num: number, base: number): string {\n if (base < 2 || base > 36) throw new Error('Base must be between 2 and 36');\n if (!Number.isInteger(num)) throw new Error('Input must be an integer');\n return num.toString(base);\n}\n\nexport function fromBase(str: string, base: number): number {\n if (base < 2 || base > 36) throw new Error('Base must be between 2 and 36');\n return parseInt(str, base);\n}\n\nexport function isBinary(str: string): boolean {\n return /^[01]+$/.test(str);\n}\n\nexport function isHex(str: string): boolean {\n return /^[0-9a-fA-F]+$/.test(str);\n}\n\nexport function isOctal(str: string): boolean {\n return /^[0-7]+$/.test(str);\n}\n\nexport function formatBytes(bytes: number, decimals: number = 2): string {\n if (bytes === 0) return '0 Bytes';\n if (bytes < 0) throw new Error('Bytes cannot be negative');\n const k = 1024;\n const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];\n const i = Math.min(Math.floor(Math.log(bytes) / Math.log(k)), sizes.length - 1);\n const sizeStr = sizes[i]!;\n return `${parseFloat((bytes / Math.pow(k, i)).toFixed(decimals))} ${sizeStr}`;\n}\n","/**\n * IP address utilities.\n * Zero-dependency for validation; os module for local IPs.\n */\n\nimport * as os from 'node:os';\n\nconst IPv4_REGEX = /^(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$/;\n\nexport function isValidIPv4(ip: string): boolean {\n return IPv4_REGEX.test(ip);\n}\n\nconst IPv6_REGEX = /^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/;\n\nexport function isValidIPv6(ip: string): boolean {\n // Also handle :: shorthand\n if (ip.includes('::')) {\n const parts = ip.split('::');\n if (parts.length !== 2) return false;\n const left = parts[0]!.split(':').filter(Boolean);\n const right = parts[1]!.split(':').filter(Boolean);\n return left.length + right.length <= 7 && left.length + right.length >= 1;\n }\n return IPv6_REGEX.test(ip);\n}\n\nexport function isValidIP(ip: string): boolean {\n return isValidIPv4(ip) || isValidIPv6(ip);\n}\n\nexport function getLocalIPs(): string[] {\n const interfaces = os.networkInterfaces();\n const ips: string[] = [];\n for (const name of Object.keys(interfaces)) {\n const iface = interfaces[name];\n if (iface === undefined) continue;\n for (const addr of iface) {\n if (addr.family === 'IPv4' && !addr.internal) {\n ips.push(addr.address);\n }\n }\n }\n return ips;\n}\n\nexport function getLocalIPv4(): string | null {\n const ips = getLocalIPs();\n return ips[0] ?? null;\n}\n\nexport function isPrivateIP(ip: string): boolean {\n if (!isValidIPv4(ip)) return false;\n const parts = ip.split('.').map(Number);\n return (\n (parts[0] === 10) ||\n (parts[0] === 172 && parts[1]! >= 16 && parts[1]! <= 31) ||\n (parts[0] === 192 && parts[1] === 168) ||\n (parts[0] === 127)\n );\n}\n\nexport function isReservedIP(ip: string): boolean {\n if (!isValidIPv4(ip)) return false;\n const parts = ip.split('.').map(Number);\n if (parts[0] === 0) return true;\n if (parts[0] === 127) return true;\n if (parts[0] === 169 && parts[1] === 254) return true;\n if (parts[0]! >= 224) return true;\n return false;\n}\n\nexport function getHostname(): string {\n return os.hostname();\n}\n","/**\n * MAC address generator and validator.\n * Zero-dependency.\n */\n\nimport { randomBytes } from 'node:crypto';\n\nconst MAC_REGEX = /^([0-9A-Fa-f]{2}[:-]){5}[0-9A-Fa-f]{2}$/;\n\nexport function isValidMAC(mac: string): boolean {\n return MAC_REGEX.test(mac);\n}\n\nexport function generateMAC(separator: string = ':'): string {\n const bytes = Array.from(randomBytes(6), (b) => b!.toString(16).padStart(2, '0').toUpperCase());\n // Set locally administered bit, unicast\n bytes[0] = ((parseInt(bytes[0]!, 16) & 0xfe) | 0x02).toString(16).padStart(2, '0').toUpperCase();\n return bytes.join(separator);\n}\n\nexport function normalizeMAC(mac: string, separator: string = ':'): string {\n const clean = mac.replace(/[-:]/g, '').toUpperCase();\n if (clean.length !== 12) throw new Error('Invalid MAC address length');\n return clean.match(/.{2}/g)!.join(separator);\n}\n\nexport function macToHex(mac: string): string {\n const clean = mac.replace(/[-:]/g, '').toLowerCase();\n if (clean.length !== 12) throw new Error('Invalid MAC address');\n return `0x${clean}`;\n}\n\nexport { randomBytes };\n","/**\n * devknife - Library Entry Point\n * The ultimate zero-dependency, 50-in-1 developer Swiss Army knife.\n *\n * @example\n * import { generateUUID, rgbToHex, base64Encode } from 'devknife';\n */\n\n// Re-export everything from tools\nexport * from './tools/index.js';\n\n// Crypto - grouped exports\nexport const hash = {\n md5: (input: string) => import('./tools/crypto/hash.js').then(m => m.md5(input)),\n sha1: (input: string) => import('./tools/crypto/hash.js').then(m => m.sha1(input)),\n sha256: (input: string) => import('./tools/crypto/hash.js').then(m => m.sha256(input)),\n sha512: (input: string) => import('./tools/crypto/hash.js').then(m => m.sha512(input)),\n};\n\n// Generators - grouped exports\nexport const uuid = {\n v4: () => import('./tools/generators/uuid.js').then(m => m.generateUUID()),\n};\n\nexport const password = {\n generate: (options?: import('./tools/crypto/password.js').PasswordOptions) =>\n import('./tools/crypto/password.js').then(m => m.generatePassword(options)),\n};\n\n// Encoders - grouped exports\nexport const base64 = {\n encode: (input: string) => import('./tools/encoders/base64.js').then(m => m.encode(input)),\n decode: (input: string) => import('./tools/encoders/base64.js').then(m => m.decode(input)),\n};\n\nexport const url = {\n encode: (input: string) => import('./tools/encoders/url.js').then(m => m.encode(input)),\n decode: (input: string) => import('./tools/encoders/url.js').then(m => m.decode(input)),\n};\n\nexport const jwt = {\n decode: (token: string) => import('./tools/encoders/jwt.js').then(m => m.decode(token)),\n};\n\nexport const json = {\n format: (input: string) => import('./tools/formatters/json.js').then(m => m.format(input)),\n minify: (input: string) => import('./tools/formatters/json.js').then(m => m.minify(input)),\n};\n\n// Formatters - grouped exports\nexport const text = {\n camelCase: (input: string) => import('./tools/formatters/text.js').then(m => m.camelCase(input)),\n snakeCase: (input: string) => import('./tools/formatters/text.js').then(m => m.snakeCase(input)),\n kebabCase: (input: string) => import('./tools/formatters/text.js').then(m => m.kebabCase(input)),\n pascalCase: (input: string) => import('./tools/formatters/text.js').then(m => m.pascalCase(input)),\n};\n\n// Converters - grouped exports\nexport const color = {\n hexToRgb: (hex: string) => import('./tools/converters/color.js').then(m => m.hexToRgb(hex)),\n rgbToHex: (r: number, g: number, b: number) => import('./tools/converters/color.js').then(m => m.rgbToHex(r, g, b)),\n};\n\nexport const time = {\n epochToIso: (epoch: number) => import('./tools/converters/time.js').then(m => m.epochToIso(epoch)),\n isoToEpoch: (iso: string) => import('./tools/converters/time.js').then(m => m.isoToEpoch(iso)),\n};\n"],"mappings":"01BAKA,OAAS,aAAAA,OAAiB,SAE1B,IAAMC,EAAmB,mEACnBC,EAAe,GAErB,SAASC,GAAaC,EAAqB,CACzC,IAAMC,EAAQ,IAAI,YAAY,CAAC,EAC/B,OAAAL,GAAU,gBAAgBK,CAAK,EACxBA,EAAM,CAAC,EAAKD,CACrB,CAOO,SAASE,EAAeC,EAAyB,CAAC,EAAW,CAClE,IAAMC,EAAOD,EAAQ,MAAQL,EACvBO,EAAWF,EAAQ,UAAYN,EAErC,GAAIQ,EAAS,SAAW,EACtB,MAAM,IAAI,MAAM,4BAA4B,EAG9C,IAAIC,EAAK,GACT,QAASC,EAAI,EAAGA,EAAIH,EAAMG,IACxBD,GAAMD,EAASN,GAAaM,EAAS,MAAM,CAAC,EAE9C,OAAOC,CACT,CAEO,SAASE,GAAcF,EAAYH,EAAyB,CAAC,EAAY,CAC9E,IAAMC,EAAOD,EAAQ,MAAQL,EACvBO,EAAWF,EAAQ,UAAYN,EACrC,OAAIS,EAAG,SAAWF,EAAa,GACxBE,EAAG,MAAM,EAAE,EAAE,MAAOG,GAAMJ,EAAS,SAASI,CAAC,CAAC,CACvD,CAEO,SAASC,GAAgBC,EAAeR,EAAyB,CAAC,EAAa,CACpF,GAAIQ,EAAQ,EAAG,MAAM,IAAI,MAAM,0BAA0B,EACzD,OAA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,EAAE,KAAKX,GAAKA,EAAE,SAASW,CAAG,CAAC,EAC1F,SAAU,CAACC,EAAWC,EAAWC,IAAc,OAAO,qBAA6B,EAAE,KAAKd,GAAKA,EAAE,SAASY,EAAGC,EAAGC,CAAC,CAAC,CACpH,EAEaC,GAAO,CAClB,WAAaC,GAAkB,OAAO,oBAA4B,EAAE,KAAKhB,GAAKA,EAAE,WAAWgB,CAAK,CAAC,EACjG,WAAaC,GAAgB,OAAO,oBAA4B,EAAE,KAAKjB,GAAKA,EAAE,WAAWiB,CAAG,CAAC,CAC/F","names":["webcrypto","DEFAULT_ALPHABET","DEFAULT_SIZE","secureRandom","max","array","generateNanoID","options","size","alphabet","id","i","isNanoIDValid","c","generateNanoIDs","count","LOREM_WORDS","randomIndex","max","capitalize","str","word","count","words","i","sentence","wordCount","paragraph","sentenceCount","sentences","paragraphs","separator","result","title","w","ENTITY_MAP","DECODE_MAP","ENTITY_REGEX","DECODE_REGEX","encode","input","char","decode","entity","encodeAttribute","stripTags","decimalToBinary","decimal","binaryToDecimal","binary","decimalToHex","hexToDecimal","hex","decimalToOctal","octalToDecimal","octal","hexToBinary","binaryToHex","toBase","num","base","fromBase","str","isBinary","isHex","isOctal","formatBytes","bytes","decimals","k","sizes","i","sizeStr","os","IPv4_REGEX","isValidIPv4","ip","IPv6_REGEX","isValidIPv6","parts","left","right","isValidIP","getLocalIPs","interfaces","ips","name","iface","addr","getLocalIPv4","isPrivateIP","isReservedIP","getHostname","randomBytes","MAC_REGEX","isValidMAC","mac","generateMAC","separator","bytes","b","normalizeMAC","clean","macToHex","hash","input","m","uuid","password","options","base64","url","jwt","token","json","text","color","hex","r","g","b","time","epoch","iso"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l}from"./chunk-ZZLUWX3F.js";export{a as camelCase,e as constantCase,f as dotCase,c as kebabCase,j as lowerCase,d as pascalCase,k as reverseCase,h as sentenceCase,l as slugify,b as snakeCase,g as titleCase,i as upperCase};
|
|
2
|
+
//# sourceMappingURL=text-PAS3LRJD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m}from"./chunk-6UIJWUAN.js";export{a as epochToIso,c as epochToLocale,k as formatDate,j as getDaysBetween,l as getWeekNumber,m as isLeapYear,i as isValidIsoDate,b as isoToEpoch,f as msToSeconds,d as nowEpoch,e as nowIso,g as secondsToMs,h as timeAgo};
|
|
2
|
+
//# sourceMappingURL=time-3XVRD5HD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "devknife",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "The ultimate zero-dependency, 50-in-1 developer Swiss Army knife CLI and library.",
|
|
5
|
+
"author": "Avinashvelu03 <avinashvelu03@gmail.com>",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"bin": {
|
|
8
|
+
"devknife": "./dist/cjs/cli.cjs"
|
|
9
|
+
},
|
|
10
|
+
"type": "module",
|
|
11
|
+
"main": "./dist/cjs/index.cjs",
|
|
12
|
+
"module": "./dist/esm/index.js",
|
|
13
|
+
"types": "./dist/types/index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"import": {
|
|
17
|
+
"types": "./dist/types/index.d.ts",
|
|
18
|
+
"default": "./dist/esm/index.js"
|
|
19
|
+
},
|
|
20
|
+
"require": {
|
|
21
|
+
"types": "./dist/types/index.d.ts",
|
|
22
|
+
"default": "./dist/cjs/index.cjs"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"./cli": {
|
|
26
|
+
"import": "./dist/esm/cli.js",
|
|
27
|
+
"require": "./dist/cjs/cli.cjs"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist",
|
|
32
|
+
"README.md",
|
|
33
|
+
"LICENSE",
|
|
34
|
+
"CHANGELOG.md"
|
|
35
|
+
],
|
|
36
|
+
"engines": {
|
|
37
|
+
"node": ">=18"
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "tsup",
|
|
41
|
+
"dev": "tsup --watch",
|
|
42
|
+
"lint": "eslint src/ tests/ --ext .ts",
|
|
43
|
+
"format": "prettier --write \"src/**/*.ts\" \"tests/**/*.ts\"",
|
|
44
|
+
"format:check": "prettier --check \"src/**/*.ts\" \"tests/**/*.ts\"",
|
|
45
|
+
"test": "vitest run",
|
|
46
|
+
"test:coverage": "vitest run --coverage",
|
|
47
|
+
"test:watch": "vitest",
|
|
48
|
+
"prepublishOnly": "npm run build && npm run test"
|
|
49
|
+
},
|
|
50
|
+
"keywords": [
|
|
51
|
+
"cli",
|
|
52
|
+
"developer-tools",
|
|
53
|
+
"swiss-army-knife",
|
|
54
|
+
"uuid",
|
|
55
|
+
"jwt",
|
|
56
|
+
"base64",
|
|
57
|
+
"hash",
|
|
58
|
+
"json-formatter",
|
|
59
|
+
"color-converter",
|
|
60
|
+
"timestamp",
|
|
61
|
+
"password-generator",
|
|
62
|
+
"lorem-ipsum",
|
|
63
|
+
"nanoid",
|
|
64
|
+
"zero-dependencies",
|
|
65
|
+
"typescript"
|
|
66
|
+
],
|
|
67
|
+
"repository": {
|
|
68
|
+
"type": "git",
|
|
69
|
+
"url": "https://github.com/Avinashvelu03/devknife"
|
|
70
|
+
},
|
|
71
|
+
"bugs": {
|
|
72
|
+
"url": "https://github.com/Avinashvelu03/devknife/issues"
|
|
73
|
+
},
|
|
74
|
+
"homepage": "https://github.com/Avinashvelu03/devknife#readme",
|
|
75
|
+
"devDependencies": {
|
|
76
|
+
"@types/node": "^20.11.0",
|
|
77
|
+
"@typescript-eslint/eslint-plugin": "^6.19.0",
|
|
78
|
+
"@typescript-eslint/parser": "^6.19.0",
|
|
79
|
+
"@vitest/coverage-v8": "^1.2.0",
|
|
80
|
+
"eslint": "^8.56.0",
|
|
81
|
+
"prettier": "^3.2.4",
|
|
82
|
+
"tsup": "^8.0.1",
|
|
83
|
+
"typescript": "^5.3.3",
|
|
84
|
+
"vitest": "^1.2.0"
|
|
85
|
+
}
|
|
86
|
+
}
|