@ix-xs/node-comfort 1.0.1 → 1.0.2
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/package.json +2 -1
- package/tsconfig.json +18 -0
- package/types/core/CLI.d.ts +25 -0
- package/types/core/CLI.d.ts.map +1 -0
- package/types/core/Checker.d.ts +73 -0
- package/types/core/Checker.d.ts.map +1 -0
- package/types/core/FS.d.ts +211 -0
- package/types/core/FS.d.ts.map +1 -0
- package/types/core/Logger.d.ts +62 -0
- package/types/core/Logger.d.ts.map +1 -0
- package/types/core/Stepper.d.ts +49 -0
- package/types/core/Stepper.d.ts.map +1 -0
- package/types/core/Storage.d.ts +111 -0
- package/types/core/Storage.d.ts.map +1 -0
- package/types/core/Utils.d.ts +55 -0
- package/types/core/Utils.d.ts.map +1 -0
- package/types/index.d.ts +122 -0
- package/types/index.d.ts.map +1 -0
package/package.json
CHANGED
package/tsconfig.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "CommonJS",
|
|
5
|
+
"allowJs": true,
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"emitDeclarationOnly": true,
|
|
8
|
+
"outDir": "types",
|
|
9
|
+
"declarationMap": true,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"forceConsistentCasingInFileNames": true,
|
|
12
|
+
"moduleResolution": "node",
|
|
13
|
+
"esModuleInterop": true,
|
|
14
|
+
"resolveJsonModule": true
|
|
15
|
+
},
|
|
16
|
+
"include": ["**/*"],
|
|
17
|
+
"exclude": ["node_modules", "types"]
|
|
18
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export class cli_stream {
|
|
2
|
+
constructor(command: any, args: any);
|
|
3
|
+
/**
|
|
4
|
+
* @typedef {"error"|"data"|"stopped"} EventName
|
|
5
|
+
* @typedef {{
|
|
6
|
+
* error: (error: Error) => void|Promise<void>,
|
|
7
|
+
* data: (message: string) => void|Promise<void>,
|
|
8
|
+
* stopped: (code: number, signal: keyof import("node:child_process").ChildProcessEventMap) => void|Promise<void>,
|
|
9
|
+
* }} EventHandler
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* @template {EventName} E
|
|
13
|
+
* @param {E} event
|
|
14
|
+
* @param {EventHandler[E]} handler
|
|
15
|
+
*/
|
|
16
|
+
on<E extends "data" | "error" | "stopped">(event: E, handler: {
|
|
17
|
+
error: (error: Error) => void | Promise<void>;
|
|
18
|
+
data: (message: string) => void | Promise<void>;
|
|
19
|
+
stopped: (code: number, signal: keyof import("node:child_process").ChildProcessEventMap) => void | Promise<void>;
|
|
20
|
+
}[E]): this;
|
|
21
|
+
stop(): Promise<any>;
|
|
22
|
+
#private;
|
|
23
|
+
}
|
|
24
|
+
export declare function cli_run(command: string): NonSharedBuffer & string;
|
|
25
|
+
//# sourceMappingURL=CLI.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CLI.d.ts","sourceRoot":"","sources":["../../core/CLI.js"],"names":[],"mappings":"AAGA;IAIE,qCAqBC;IAED;;;;;;;SAOE;IACF;;;;SAIE;IACF,GAJwB,CAAC,SAAb,4BAAW,SACb,CAAC;eAPF,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAC,OAAO,CAAC,IAAI,CAAC;cACrC,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,GAAC,OAAO,CAAC,IAAI,CAAC;iBACpC,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,OAAO,oBAAoB,EAAE,oBAAoB,KAAK,IAAI,GAAC,OAAO,CAAC,IAAI,CAAC;gBAW/G;IAED,qBA4BC;;CACF;AAUU,yCAFC,MAAM,4BAOf"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if the value is an array.
|
|
3
|
+
* @param {*} value - The value to check.
|
|
4
|
+
* @returns {boolean} Returns `true` if the value is an array, otherwise `false`.
|
|
5
|
+
*/
|
|
6
|
+
export function isArray(value: any): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Checks if the value is a valid number (not NaN).
|
|
9
|
+
* @param {*} value - The value to check.
|
|
10
|
+
* @returns {boolean} Returns `true` if the value is a valid number, otherwise `false`.
|
|
11
|
+
*/
|
|
12
|
+
export function isNumber(value: any): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Checks if the value is a function.
|
|
15
|
+
* @param {*} value - The value to check.
|
|
16
|
+
* @returns {boolean} Returns `true` if the value is a function, otherwise `false`.
|
|
17
|
+
*/
|
|
18
|
+
export function isFunction(value: any): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Checks if the value is an object (and not `null`).
|
|
21
|
+
* @param {*} value - The value to check.
|
|
22
|
+
* @returns {boolean} Returns `true` if the value is a non-null object, otherwise `false`.
|
|
23
|
+
*/
|
|
24
|
+
export function isObject(value: any): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Checks if the value is a boolean.
|
|
27
|
+
* @param {*} value - The value to check.
|
|
28
|
+
* @returns {boolean} Returns `true` if the value is a boolean, otherwise `false`.
|
|
29
|
+
*/
|
|
30
|
+
export function isBoolean(value: any): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Checks if the value is a string.
|
|
33
|
+
* @param {*} value - The value to check.
|
|
34
|
+
* @returns {boolean} Returns `true` if the value is a string, otherwise `false`.
|
|
35
|
+
*/
|
|
36
|
+
export function isString(value: any): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Checks if the value is `undefined`.
|
|
39
|
+
* @param {*} value - The value to check.
|
|
40
|
+
* @returns {boolean} Returns `true` if the value is `undefined`, otherwise `false`.
|
|
41
|
+
*/
|
|
42
|
+
export function isUndefined(value: any): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Checks if the value is `null`.
|
|
45
|
+
* @param {*} value - The value to check.
|
|
46
|
+
* @returns {boolean} Returns `true` if the value is `null`, otherwise `false`.
|
|
47
|
+
*/
|
|
48
|
+
export function isNull(value: any): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Checks if the value is a valid `Date` object.
|
|
51
|
+
* @param {*} value - The value to check.
|
|
52
|
+
* @returns {boolean} Returns `true` if the value is an instance of `Date`, otherwise `false`.
|
|
53
|
+
*/
|
|
54
|
+
export function isDate(value: any): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Checks if the value is a `Map` instance.
|
|
57
|
+
* @param {*} value - The value to check.
|
|
58
|
+
* @returns {boolean} Returns `true` if the value is a Map, otherwise `false`.
|
|
59
|
+
*/
|
|
60
|
+
export function isMap(value: any): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Checks if the value is a `Set` instance.
|
|
63
|
+
* @param {*} value - The value to check.
|
|
64
|
+
* @returns {boolean} Returns `true` if the value is a Set, otherwise `false`.
|
|
65
|
+
*/
|
|
66
|
+
export function isSet(value: any): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Checks if the value is a native JavaScript error (`Error`, `TypeError`, etc.).
|
|
69
|
+
* @param {*} value - The value to check.
|
|
70
|
+
* @returns {boolean} Returns `true` if the value is a native error, otherwise `false`.
|
|
71
|
+
*/
|
|
72
|
+
export function isError(value: any): boolean;
|
|
73
|
+
//# sourceMappingURL=Checker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checker.d.ts","sourceRoot":"","sources":["../../core/Checker.js"],"names":[],"mappings":"AAmBE;;;;KAIE;AACF,+BAHU,GAAC,GACC,OAAO,CAIlB;AAED;;;;KAIE;AACF,gCAHU,GAAC,GACC,OAAO,CAIlB;AAED;;;;KAIE;AACF,kCAHU,GAAC,GACC,OAAO,CAIlB;AAED;;;;KAIE;AACF,gCAHU,GAAC,GACC,OAAO,CAIlB;AAED;;;;KAIE;AACF,iCAHU,GAAC,GACC,OAAO,CAIlB;AAED;;;;KAIE;AACF,gCAHU,GAAC,GACC,OAAO,CAIlB;AAED;;;;KAIE;AACF,mCAHU,GAAC,GACC,OAAO,CAIlB;AAED;;;;KAIE;AACF,8BAHU,GAAC,GACC,OAAO,CAIlB;AAED;;;;KAIE;AACF,8BAHU,GAAC,GACC,OAAO,CAIlB;AAED;;;;KAIE;AACF,6BAHU,GAAC,GACC,OAAO,CAIlB;AAED;;;;KAIE;AACF,6BAHU,GAAC,GACC,OAAO,CAIlB;AAED;;;;KAIE;AACF,+BAHU,GAAC,GACC,OAAO,CAIlB"}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Safely read an environment variable.
|
|
3
|
+
*
|
|
4
|
+
* Loads variables from the default `.env` file (if present) and then
|
|
5
|
+
* returns the value for the given key. When `options.envFile` is provided,
|
|
6
|
+
* the function expects `process.env[options.envFile]` to be an object
|
|
7
|
+
* containing namespaced environment variables (e.g. per environment).
|
|
8
|
+
*
|
|
9
|
+
* @param {string} env - Environment variable name (e.g. "PORT").
|
|
10
|
+
* @param {object} [options] - Optional configuration object.
|
|
11
|
+
* @param {string} [options.envFile] - Name of a namespaced env container under `process.env`.
|
|
12
|
+
* @returns {string|undefined} The environment variable value, or `undefined` if not found.
|
|
13
|
+
*/
|
|
14
|
+
export function getEnv(env: string, options?: {
|
|
15
|
+
envFile?: string;
|
|
16
|
+
}): string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Resolves path relative to caller file or current directory.
|
|
19
|
+
* Supports `./`, `../`, absolute paths, and searches for existing paths.
|
|
20
|
+
* @param {string} [path=process.cwd()] - Path to resolve.
|
|
21
|
+
* @returns {string} Resolved absolute path.
|
|
22
|
+
* @example
|
|
23
|
+
* nodeComfort.createPath("./data/users"); // Resolves from caller file
|
|
24
|
+
*/
|
|
25
|
+
export function createPath(path?: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* Returns all folders in path (recursive option).
|
|
28
|
+
* @param {string} [path=process.cwd()] - Starting directory.
|
|
29
|
+
* @param {boolean} [recursive=true] - Include subfolders.
|
|
30
|
+
* @returns {string[]|undefined} Array of folder paths.
|
|
31
|
+
*/
|
|
32
|
+
export function getFoldersIn(path?: string, recursive?: boolean): string[] | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Resolves and returns existing folder path.
|
|
35
|
+
* @param {string} [path=process.cwd()] - Folder path.
|
|
36
|
+
* @returns {string|undefined} Absolute folder path.
|
|
37
|
+
*/
|
|
38
|
+
export function getFolder(path?: string): string | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Returns all files in path (recursive option).
|
|
41
|
+
* @param {string} [path=process.cwd()] - Starting directory.
|
|
42
|
+
* @param {boolean} [recursive=true] - Include subdirectories.
|
|
43
|
+
* @returns {string[]|undefined} Array of file paths.
|
|
44
|
+
*/
|
|
45
|
+
export function getFilesIn(path?: string, recursive?: boolean): string[] | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Resolves and returns existing file path.
|
|
48
|
+
* @param {string} path - File path.
|
|
49
|
+
* @returns {string|undefined} Absolute file path.
|
|
50
|
+
*/
|
|
51
|
+
export function getFile(path: string): string | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Creates folder (recursive) with force overwrite option.
|
|
54
|
+
* @param {string} path - Folder path to create.
|
|
55
|
+
* @param {boolean} [force=false] - Overwrite if exists.
|
|
56
|
+
* @returns {boolean|undefined} Success status.
|
|
57
|
+
*/
|
|
58
|
+
export function createFolder(path: string, force?: boolean): boolean | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Creates file with auto-directory creation and content serialization.
|
|
61
|
+
* Supports string, object (→ JSON), null/undefined (→ empty).
|
|
62
|
+
* @param {string} path - File path.
|
|
63
|
+
* @param {boolean} [force=false] - Overwrite if exists.
|
|
64
|
+
* @param {string|object|null|undefined} [data] - File content.
|
|
65
|
+
* @returns {boolean|undefined} Success status.
|
|
66
|
+
* @example
|
|
67
|
+
* nodeComfort.createFile("config.json", false, { apiKey: "secret" });
|
|
68
|
+
*/
|
|
69
|
+
export function createFile(path: string, force?: boolean, data?: string | object | null | undefined): boolean | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Deletes multiple folders matching filter.
|
|
72
|
+
* @param {string} [path=process.cwd()] - Starting directory.
|
|
73
|
+
* @param {(folder: string) => boolean} [filter] - Folder filter function.
|
|
74
|
+
* @returns {number|undefined} Count of deleted folders.
|
|
75
|
+
*/
|
|
76
|
+
export function deleteFoldersIn(path?: string, filter?: (folder: string) => boolean): number | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* Deletes folder and all contents recursively.
|
|
79
|
+
* @param {string} path - Folder path.
|
|
80
|
+
* @returns {boolean|undefined} Success status.
|
|
81
|
+
*/
|
|
82
|
+
export function deleteFolder(path: string): boolean | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* Deletes multiple files matching filter.
|
|
85
|
+
* @param {string} [path=process.cwd()] - Starting directory.
|
|
86
|
+
* @param {boolean} [recursive=false] - Search subdirectories.
|
|
87
|
+
* @param {(file: string) => boolean} [filter] - File filter function.
|
|
88
|
+
* @returns {number|undefined} Count of deleted files.
|
|
89
|
+
*/
|
|
90
|
+
export function deleteFilesIn(path?: string, recursive?: boolean, filter?: (file: string) => boolean): number | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* Deletes single file.
|
|
93
|
+
* @param {string} path - File path.
|
|
94
|
+
* @returns {boolean|undefined} Success status.
|
|
95
|
+
*/
|
|
96
|
+
export function deleteFile(path: string): boolean | undefined;
|
|
97
|
+
/**
|
|
98
|
+
* Copies multiple folders with optional files and recursive support.
|
|
99
|
+
* @param {Object} options - Copy options.
|
|
100
|
+
* @param {string} options.dest - Destination base path.
|
|
101
|
+
* @param {string} [options.path] - Source path.
|
|
102
|
+
* @param {boolean} [options.recursive=true] - Copy subfolders.
|
|
103
|
+
* @param {boolean} [options.withFiles=false] - Include files.
|
|
104
|
+
* @param {boolean} [options.force=false] - Overwrite existing.
|
|
105
|
+
* @param {(folder: string) => boolean} [options.filter] - Folder filter.
|
|
106
|
+
* @returns {number|undefined} Count of copied folders.
|
|
107
|
+
*/
|
|
108
|
+
export function copyFoldersIn(options: {
|
|
109
|
+
dest: string;
|
|
110
|
+
path?: string;
|
|
111
|
+
recursive?: boolean;
|
|
112
|
+
withFiles?: boolean;
|
|
113
|
+
force?: boolean;
|
|
114
|
+
filter?: (folder: string) => boolean;
|
|
115
|
+
}): number | undefined;
|
|
116
|
+
/**
|
|
117
|
+
* Copies single folder with optional contents.
|
|
118
|
+
* @param {Object} options - Copy options.
|
|
119
|
+
* @param {string} options.dest - Destination path.
|
|
120
|
+
* @param {string} [options.path] - Source path.
|
|
121
|
+
* @param {boolean} [options.recursive=false] - Copy subfolders.
|
|
122
|
+
* @param {boolean} [options.withFiles=false] - Include files.
|
|
123
|
+
* @param {boolean} [options.force=false] - Overwrite existing.
|
|
124
|
+
* @returns {boolean|undefined} Success status.
|
|
125
|
+
*/
|
|
126
|
+
export function copyFolder(options: {
|
|
127
|
+
dest: string;
|
|
128
|
+
path?: string;
|
|
129
|
+
recursive?: boolean;
|
|
130
|
+
withFiles?: boolean;
|
|
131
|
+
force?: boolean;
|
|
132
|
+
}): boolean | undefined;
|
|
133
|
+
/**
|
|
134
|
+
* Copies multiple files with optional recursive structure preservation.
|
|
135
|
+
* @param {Object} options - Copy options.
|
|
136
|
+
* @param {string} options.dest - Destination base path.
|
|
137
|
+
* @param {string} [options.path] - Source path.
|
|
138
|
+
* @param {boolean} [options.recursive=true] - Preserve directory structure.
|
|
139
|
+
* @param {boolean} [options.force=false] - Overwrite existing.
|
|
140
|
+
* @param {(file: string) => boolean} [options.filter] - File filter.
|
|
141
|
+
* @returns {number|undefined} Count of copied files.
|
|
142
|
+
*/
|
|
143
|
+
export function copyFilesIn(options: {
|
|
144
|
+
dest: string;
|
|
145
|
+
path?: string;
|
|
146
|
+
recursive?: boolean;
|
|
147
|
+
force?: boolean;
|
|
148
|
+
filter?: (file: string) => boolean;
|
|
149
|
+
}): number | undefined;
|
|
150
|
+
/**
|
|
151
|
+
* Copies single file to destination (auto-creates parent folders).
|
|
152
|
+
* @param {Object} options - Copy options.
|
|
153
|
+
* @param {string} options.path - Source file path.
|
|
154
|
+
* @param {string} options.dest - Destination path or folder.
|
|
155
|
+
* @param {boolean} [options.force=false] - Overwrite existing.
|
|
156
|
+
* @returns {boolean|undefined} Success status.
|
|
157
|
+
*/
|
|
158
|
+
export function copyFile(options: {
|
|
159
|
+
path: string;
|
|
160
|
+
dest: string;
|
|
161
|
+
force?: boolean;
|
|
162
|
+
}): boolean | undefined;
|
|
163
|
+
/**
|
|
164
|
+
* Moves multiple folders (copy + delete source).
|
|
165
|
+
* @param {Object} options - Move options (same as copyFoldersIn).
|
|
166
|
+
* @returns {number|undefined} Count of moved folders.
|
|
167
|
+
*/
|
|
168
|
+
export function moveFoldersIn(options: any): number | undefined;
|
|
169
|
+
/**
|
|
170
|
+
* Moves single folder (copy + delete source).
|
|
171
|
+
* @param {Object} options - Move options (same as copyFolder).
|
|
172
|
+
* @returns {boolean|undefined} Success status.
|
|
173
|
+
*/
|
|
174
|
+
export function moveFolder(options: any): boolean | undefined;
|
|
175
|
+
/**
|
|
176
|
+
* Moves multiple files (copy + delete source).
|
|
177
|
+
* @param {Object} options - Move options (same as copyFilesIn).
|
|
178
|
+
* @returns {number|undefined} Count of moved files.
|
|
179
|
+
*/
|
|
180
|
+
export function moveFilesIn(options: any): number | undefined;
|
|
181
|
+
/**
|
|
182
|
+
* Moves single file (copy + delete source).
|
|
183
|
+
* @param {Object} options - Move options (same as copyFile).
|
|
184
|
+
* @returns {boolean|undefined} Success status.
|
|
185
|
+
*/
|
|
186
|
+
export function moveFile(options: any): boolean | undefined;
|
|
187
|
+
/**
|
|
188
|
+
* Reads file content synchronously.
|
|
189
|
+
* @param {string} path - File path.
|
|
190
|
+
* @returns {string|undefined} File content or undefined.
|
|
191
|
+
*/
|
|
192
|
+
export function readFile(path: string): string | undefined;
|
|
193
|
+
/**
|
|
194
|
+
* Creates file system watcher with event filtering and pause/resume.
|
|
195
|
+
* @param {Object} [options] - Watcher options.
|
|
196
|
+
* @param {string} [options.path=process.cwd()] - Watch path.
|
|
197
|
+
* @param {boolean} [options.recursive=false] - Watch subdirectories.
|
|
198
|
+
* @param {(event: string, file: string) => boolean} [options.filter] - Event filter.
|
|
199
|
+
* @returns {Object|undefined} Watcher API.
|
|
200
|
+
* @example
|
|
201
|
+
* const watcher = nodeComfort.watch({ path: "./src", recursive: true });
|
|
202
|
+
* watcher.on("change", (file) => console.log("Changed:", file));
|
|
203
|
+
* watcher.on("rename", (file) => console.log("Renamed:", file));
|
|
204
|
+
* watcher.on("all", (event, file) => console.log(event, file));
|
|
205
|
+
*/
|
|
206
|
+
export function watch(options?: {
|
|
207
|
+
path?: string;
|
|
208
|
+
recursive?: boolean;
|
|
209
|
+
filter?: (event: string, file: string) => boolean;
|
|
210
|
+
}): any | undefined;
|
|
211
|
+
//# sourceMappingURL=FS.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FS.d.ts","sourceRoot":"","sources":["../../core/FS.js"],"names":[],"mappings":"AAwME;;;;;;;;;;;;KAYE;AACF,4BALU,MAAM,YAEd;IAAyB,OAAO,GAAxB,MAAM;CACd,GAAU,MAAM,GAAC,SAAS,CAO3B;AACD;;;;;;;KAOE;AACF,kCALU,MAAM,GACJ,MAAM,CAajB;AAED;;;;;KAKE;AACF,oCAJU,MAAM,cACN,OAAO,GACL,MAAM,EAAE,GAAC,SAAS,CAK7B;AAED;;;;KAIE;AACF,iCAHU,MAAM,GACJ,MAAM,GAAC,SAAS,CAI3B;AAED;;;;;KAKE;AACF,kCAJU,MAAM,cACN,OAAO,GACL,MAAM,EAAE,GAAC,SAAS,CAK7B;AAED;;;;KAIE;AACF,8BAHU,MAAM,GACJ,MAAM,GAAC,SAAS,CAI3B;AAED;;;;;KAKE;AACF,mCAJU,MAAM,UACN,OAAO,GACL,OAAO,GAAC,SAAS,CAoB5B;AAED;;;;;;;;;KASE;AACF,iCAPU,MAAM,UACN,OAAO,SACP,MAAM,GAAC,MAAM,GAAC,IAAI,GAAC,SAAS,GAC1B,OAAO,GAAC,SAAS,CAiC5B;AAED;;;;;KAKE;AACF,uCAJU,MAAM,WACN,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,GACzB,MAAM,GAAC,SAAS,CAe3B;AAED;;;;KAIE;AACF,mCAHU,MAAM,GACJ,OAAO,GAAC,SAAS,CAY5B;AAED;;;;;;KAME;AACF,qCALU,MAAM,cACN,OAAO,WACP,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GACvB,MAAM,GAAC,SAAS,CAe3B;AAED;;;;KAIE;AACF,iCAHU,MAAM,GACJ,OAAO,GAAC,SAAS,CAY5B;AAED;;;;;;;;;;KAUE;AACF,uCARE;IAAwB,IAAI,EAApB,MAAM;IACW,IAAI,GAArB,MAAM;IACY,SAAS,GAA3B,OAAO;IACW,SAAS,GAA3B,OAAO;IACW,KAAK,GAAvB,OAAO;IAC+B,MAAM,GAA5C,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO;CACnC,GAAU,MAAM,GAAC,SAAS,CA0C3B;AAED;;;;;;;;;KASE;AACF,oCAPE;IAAwB,IAAI,EAApB,MAAM;IACW,IAAI,GAArB,MAAM;IACY,SAAS,GAA3B,OAAO;IACW,SAAS,GAA3B,OAAO;IACW,KAAK,GAAvB,OAAO;CACf,GAAU,OAAO,GAAC,SAAS,CA0C5B;AAED;;;;;;;;;KASE;AACF,qCAPE;IAAwB,IAAI,EAApB,MAAM;IACW,IAAI,GAArB,MAAM;IACY,SAAS,GAA3B,OAAO;IACW,KAAK,GAAvB,OAAO;IAC6B,MAAM,GAA1C,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO;CACjC,GAAU,MAAM,GAAC,SAAS,CA+B3B;AAED;;;;;;;KAOE;AACF,kCALE;IAAwB,IAAI,EAApB,MAAM;IACU,IAAI,EAApB,MAAM;IACY,KAAK,GAAvB,OAAO;CACf,GAAU,OAAO,GAAC,SAAS,CAwB5B;AAED;;;;KAIE;AACF,6CAFY,MAAM,GAAC,SAAS,CAkB3B;AAED;;;;KAIE;AACF,0CAFY,OAAO,GAAC,SAAS,CAS5B;AAED;;;;KAIE;AACF,2CAFY,MAAM,GAAC,SAAS,CAkB3B;AAED;;;;KAIE;AACF,wCAFY,OAAO,GAAC,SAAS,CAS5B;AAED;;;;KAIE;AACF,+BAHU,MAAM,GACJ,MAAM,GAAC,SAAS,CAW3B;AAED;;;;;;;;;;;;KAYE;AACF,gCAVE;IAAyB,IAAI,GAArB,MAAM;IACY,SAAS,GAA3B,OAAO;IAC4C,MAAM,GAAzD,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO;CAChD,GAAU,MAAO,SAAS,CAmE3B"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logs content with colors, timestamp, and group indentation.
|
|
3
|
+
* Supports strings, objects (pretty JSON), and chaining.
|
|
4
|
+
*
|
|
5
|
+
* @param {any} content - Content to log (string, object, or primitive).
|
|
6
|
+
* @returns {this} Chainable instance.
|
|
7
|
+
* @example
|
|
8
|
+
* nodeComfort.log("<%greenBright ✓ Done%>");
|
|
9
|
+
* nodeComfort.log({ users: 42, active: true });
|
|
10
|
+
* nodeComfort.group("Files").log("Processing...").groupEnd();
|
|
11
|
+
*/
|
|
12
|
+
export function log(content: any): this;
|
|
13
|
+
/**
|
|
14
|
+
* Formats content with colors, timestamp, and group indentation (no console output).
|
|
15
|
+
*
|
|
16
|
+
* @param {any} content - Content to format.
|
|
17
|
+
* @returns {string} Formatted string.
|
|
18
|
+
* @example
|
|
19
|
+
* const msg = nodeComfort.logify("<%redBright ERROR%> Invalid input");
|
|
20
|
+
* console.log(msg);
|
|
21
|
+
*/
|
|
22
|
+
export function logify(content: any): string;
|
|
23
|
+
/**
|
|
24
|
+
* Starts a new log group with ▼ indicator and increased indentation.
|
|
25
|
+
*
|
|
26
|
+
* @param {string} label - Group label (supports colors).
|
|
27
|
+
* @returns {this} Chainable instance.
|
|
28
|
+
* @example
|
|
29
|
+
* nodeComfort.group("<%yellow Processing%>").log("Step 1").groupEnd();
|
|
30
|
+
*/
|
|
31
|
+
export function group(label: string): this;
|
|
32
|
+
/**
|
|
33
|
+
* Ends current group and reduces indentation.
|
|
34
|
+
*
|
|
35
|
+
* @returns {this} Chainable instance.
|
|
36
|
+
* @example
|
|
37
|
+
* nodeComfort.group("Work").groupEnd();
|
|
38
|
+
*/
|
|
39
|
+
export function groupEnd(): this;
|
|
40
|
+
/**
|
|
41
|
+
* Configures logger options (delimiters and timestamp).
|
|
42
|
+
*
|
|
43
|
+
* @param {object} [options] - Logger options.
|
|
44
|
+
* @param {object} [options.delimiters] - Template delimiters.
|
|
45
|
+
* @param {string} [options.delimiters.start="<%="] - Start delimiter.
|
|
46
|
+
* @param {string} [options.delimiters.end="%>"] - End delimiter.
|
|
47
|
+
* @param {boolean} [options.timestamp=true] - Show timestamps.
|
|
48
|
+
* @returns {this} Chainable instance.
|
|
49
|
+
* @example
|
|
50
|
+
* nodeComfort.setLogger({
|
|
51
|
+
* delimiters: { start: "{{", end: "}}" },
|
|
52
|
+
* timestamp: false
|
|
53
|
+
* }).log("{{ bgGreen new delimiters }}");
|
|
54
|
+
*/
|
|
55
|
+
export function setLogger(options?: {
|
|
56
|
+
delimiters?: {
|
|
57
|
+
start?: string;
|
|
58
|
+
end?: string;
|
|
59
|
+
};
|
|
60
|
+
timestamp?: boolean;
|
|
61
|
+
}): this;
|
|
62
|
+
//# sourceMappingURL=Logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Logger.d.ts","sourceRoot":"","sources":["../../core/Logger.js"],"names":[],"mappings":"AAuME;;;;;;;;;;KAUE;AACF,6BAPU,GAAG,GACD,IAAI,CAqCf;AAED;;;;;;;;KAQE;AACF,gCANU,GAAG,GACD,MAAM,CAiBjB;AAED;;;;;;;KAOE;AACF,6BALU,MAAM,GACJ,IAAI,CASf;AAED;;;;;;KAME;AACF,4BAJY,IAAI,CAOf;AAED;;;;;;;;;;;;;;KAcE;AACF,oCAXE;IAAyB,UAAU,GACnC;QAAoC,KAAK,GAAjC,MAAM;QACsB,GAAG,GAA/B,MAAM;KACd;IAA0B,SAAS,GAA3B,OAAO;CACf,GAAU,IAAI,CAkBf"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a step controller for sequential function execution.
|
|
3
|
+
*
|
|
4
|
+
* Returns fluent API with `next()`, `back()`, `at()`, `ignore()`, `reset()` methods.
|
|
5
|
+
*
|
|
6
|
+
* @param {Array<() => void>} steps - Array of step functions to execute.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* const steps = nodeComfort.step([
|
|
10
|
+
* () => console.log("Install dependencies"),
|
|
11
|
+
* () => console.log("Compile TypeScript"),
|
|
12
|
+
* () => console.log("Run tests")
|
|
13
|
+
* ]);
|
|
14
|
+
*
|
|
15
|
+
* steps.next().next(); // Execute steps 0, 1
|
|
16
|
+
* steps.back(); // Go back to step 0
|
|
17
|
+
* steps.at(2); // Jump to step 2
|
|
18
|
+
*/
|
|
19
|
+
export function step(steps: Array<() => void>): {
|
|
20
|
+
currentIndex: number;
|
|
21
|
+
currentStep: () => void;
|
|
22
|
+
/**
|
|
23
|
+
* Advances to next step and executes it (if exists).
|
|
24
|
+
*/
|
|
25
|
+
next(): /*elided*/ any;
|
|
26
|
+
/**
|
|
27
|
+
* Goes back to previous step and re-executes it (if exists).
|
|
28
|
+
*/
|
|
29
|
+
back(): /*elided*/ any;
|
|
30
|
+
/**
|
|
31
|
+
* Jumps to specific step index and executes it.
|
|
32
|
+
* @param {number} index - Step index (0 to steps.length-1).
|
|
33
|
+
* @example
|
|
34
|
+
* steps.at(2); // Jump to 3rd step
|
|
35
|
+
*/
|
|
36
|
+
at(index: number): /*elided*/ any;
|
|
37
|
+
/**
|
|
38
|
+
* Advances index without executing current step.
|
|
39
|
+
* @example
|
|
40
|
+
* steps.next().ignore().next(); // Execute 0, skip 1, execute 2
|
|
41
|
+
*/
|
|
42
|
+
ignore(): /*elided*/ any;
|
|
43
|
+
/**
|
|
44
|
+
* Resets to initial state (index: -1).
|
|
45
|
+
*/
|
|
46
|
+
reset(): /*elided*/ any;
|
|
47
|
+
all(): /*elided*/ any;
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=Stepper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Stepper.d.ts","sourceRoot":"","sources":["../../core/Stepper.js"],"names":[],"mappings":"AA6BE;;;;;;;;;;;;;;;;;KAiBE;AACF,4BAbU,KAAK,CAAC,MAAM,IAAI,CAAC;;uBAAL,IAAI;IAmBtB;;aAEA;;IAQA;;aAEA;;IAQA;;;;;aAKA;cAHQ,MAAM;IAWd;;;;aAIA;;IAOA;;aAEA;;;EAcH"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
export = Storage;
|
|
2
|
+
declare class Storage {
|
|
3
|
+
/**
|
|
4
|
+
* @param {string} [path = ":memomry"]
|
|
5
|
+
*/
|
|
6
|
+
constructor(path?: string);
|
|
7
|
+
/**
|
|
8
|
+
* @param {string} sql
|
|
9
|
+
* @param {array|object} [options = []]
|
|
10
|
+
*/
|
|
11
|
+
exec(sql: string, options?: any[] | object): {
|
|
12
|
+
changes: any;
|
|
13
|
+
lastInsertRowid: any;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* @param {string} sql
|
|
17
|
+
* @param {array|object} [options = []]
|
|
18
|
+
*/
|
|
19
|
+
getOne(sql: string, options?: any[] | object): any;
|
|
20
|
+
/**
|
|
21
|
+
* @param {string} sql
|
|
22
|
+
* @param {array|object} [options = []]
|
|
23
|
+
*/
|
|
24
|
+
getAll(sql: string, options?: any[] | object): any;
|
|
25
|
+
/**
|
|
26
|
+
* @param {string} name
|
|
27
|
+
* @param {string} sql
|
|
28
|
+
*/
|
|
29
|
+
prepare(name: string, sql: string): any;
|
|
30
|
+
/**
|
|
31
|
+
* @param {string} table
|
|
32
|
+
* @param {object} schema
|
|
33
|
+
*/
|
|
34
|
+
createTable(table: string, schema: object): void;
|
|
35
|
+
/**
|
|
36
|
+
* @param {string} table
|
|
37
|
+
* @param {object} data
|
|
38
|
+
*/
|
|
39
|
+
insert(table: string, data: object): any;
|
|
40
|
+
/**
|
|
41
|
+
* @param {string} table
|
|
42
|
+
* @param {number} id
|
|
43
|
+
* @returns {object|null}
|
|
44
|
+
*/
|
|
45
|
+
findById(table: string, id: number): object | null;
|
|
46
|
+
/**
|
|
47
|
+
* @param {string} table
|
|
48
|
+
* @param {object} [where = {}]
|
|
49
|
+
* @param {object} [options = {}]
|
|
50
|
+
*/
|
|
51
|
+
findAll(table: string, where?: object, options?: object): any;
|
|
52
|
+
/**
|
|
53
|
+
* @param {string} table
|
|
54
|
+
* @param {object} [where]
|
|
55
|
+
*/
|
|
56
|
+
count(table: string, where?: object): any;
|
|
57
|
+
/**
|
|
58
|
+
* @param {string} table
|
|
59
|
+
* @param {number} id
|
|
60
|
+
* @param {object} data
|
|
61
|
+
*/
|
|
62
|
+
update(table: string, id: number, data: object): any;
|
|
63
|
+
/**
|
|
64
|
+
* @param {string} table
|
|
65
|
+
* @param {number} id
|
|
66
|
+
*/
|
|
67
|
+
delete(table: string, id: number): any;
|
|
68
|
+
/**
|
|
69
|
+
* @param {string} table
|
|
70
|
+
* @param {object} data
|
|
71
|
+
* @param {string} [conflictColumn]
|
|
72
|
+
*/
|
|
73
|
+
upsert(table: string, data: object, conflictColumn?: string): {
|
|
74
|
+
changes: any;
|
|
75
|
+
lastInsertRowid: any;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* @param {function} callback
|
|
79
|
+
*/
|
|
80
|
+
transaction(callback: Function): any;
|
|
81
|
+
/**
|
|
82
|
+
* @param {string} migrationsDir - Répertoire contenant les migrations
|
|
83
|
+
*/
|
|
84
|
+
runMigrations(migrationsDir: string): void;
|
|
85
|
+
/**
|
|
86
|
+
* @param {string} table
|
|
87
|
+
*/
|
|
88
|
+
export(table: string): any;
|
|
89
|
+
/**
|
|
90
|
+
* @param {string} table
|
|
91
|
+
* @param {array} data
|
|
92
|
+
*/
|
|
93
|
+
import(table: string, data: any[]): number;
|
|
94
|
+
/**
|
|
95
|
+
* @param {string} table
|
|
96
|
+
*/
|
|
97
|
+
truncate(table: string): void;
|
|
98
|
+
/**
|
|
99
|
+
* @param {string} indexName
|
|
100
|
+
* @param {string} table
|
|
101
|
+
* @param {string} columns
|
|
102
|
+
*/
|
|
103
|
+
createIndex(indexName: string, table: string, columns: string): void;
|
|
104
|
+
/**
|
|
105
|
+
* @returns {object}
|
|
106
|
+
*/
|
|
107
|
+
stats(): object;
|
|
108
|
+
close(): void;
|
|
109
|
+
#private;
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=Storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Storage.d.ts","sourceRoot":"","sources":["../../core/Storage.js"],"names":[],"mappings":";AAmBiB;IAIf;;OAEG;IACH,mBAFW,MAAM,EAehB;IAED;;;OAGG;IACH,UAHW,MAAM,YACN,QAAM,MAAM;;;MAetB;IAED;;;OAGG;IACH,YAHW,MAAM,YACN,QAAM,MAAM,OAUtB;IAED;;;OAGG;IACH,YAHW,MAAM,YACN,QAAM,MAAM,OAUtB;IAED;;;OAGG;IACH,cAHW,MAAM,OACN,MAAM,OAYhB;IAED;;;OAGG;IACH,mBAHW,MAAM,UACN,MAAM,QAUhB;IAED;;;OAGG;IACH,cAHW,MAAM,QACN,MAAM,OAUhB;IAED;;;;OAIG;IACH,gBAJW,MAAM,MACN,MAAM,GACJ,MAAM,GAAC,IAAI,CAIvB;IAED;;;;OAIG;IACH,eAJW,MAAM,UACN,MAAM,YACN,MAAM,OAmBhB;IAED;;;OAGG;IACH,aAHW,MAAM,UACN,MAAM,OAehB;IAED;;;;OAIG;IACH,cAJW,MAAM,MACN,MAAM,QACN,MAAM,OAUhB;IAED;;;OAGG;IACH,cAHW,MAAM,MACN,MAAM,OAOhB;IAED;;;;OAIG;IACH,cAJW,MAAM,QACN,MAAM,mBACN,MAAM;;;MAkBhB;IAED;;OAEG;IACH,qCAaC;IAED;;OAEG;IACH,6BAFW,MAAM,QA+BhB;IAED;;OAEG;IACH,cAFW,MAAM,OAIhB;IAED;;;OAGG;IACH,cAHW,MAAM,uBAYhB;IAED;;OAEG;IACH,gBAFW,MAAM,QAIhB;IAED;;;;OAIG;IACH,uBAJW,MAAM,SACN,MAAM,WACN,MAAM,QAIhB;IAED;;OAEG;IACH,SAFa,MAAM,CAclB;IAED,cAMC;;CACF"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export function getEnv(env: any): string;
|
|
2
|
+
/**
|
|
3
|
+
* Creates a Promise that resolves after specified milliseconds.
|
|
4
|
+
*
|
|
5
|
+
* @param {number} ms - Milliseconds to wait (positive integer).
|
|
6
|
+
* @returns {Promise<void>} Promise that resolves after delay.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* // Sequential delays
|
|
10
|
+
* await wait(100); // 100ms
|
|
11
|
+
* await wait(500); // 500ms
|
|
12
|
+
* await wait(2000); // 2 seconds
|
|
13
|
+
*/
|
|
14
|
+
export function wait(ms: number): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @param {boolean|Promise<boolean>} predicate
|
|
18
|
+
* @param {*} handler
|
|
19
|
+
* @param {object} [options]
|
|
20
|
+
* @param {number} [options.interval]
|
|
21
|
+
* @param {number|null} [options.timeout]
|
|
22
|
+
* @param {number|null} [options.max]
|
|
23
|
+
*/
|
|
24
|
+
export function when(predicate: boolean | Promise<boolean>, handler: any, options?: {
|
|
25
|
+
interval?: number;
|
|
26
|
+
timeout?: number | null;
|
|
27
|
+
max?: number | null;
|
|
28
|
+
}): {
|
|
29
|
+
start(): /*elided*/ any;
|
|
30
|
+
stop(): /*elided*/ any;
|
|
31
|
+
/**
|
|
32
|
+
* @param {"error"|"trigger"|"timeout"} event
|
|
33
|
+
* @param {(payload: any) => void} fn
|
|
34
|
+
*/
|
|
35
|
+
on(event: "error" | "trigger" | "timeout", fn: (payload: any) => void): /*elided*/ any;
|
|
36
|
+
/**
|
|
37
|
+
* @param {"error"|"trigger"|"timeout"} event
|
|
38
|
+
* @param {(payload: any) => void} fn
|
|
39
|
+
*/
|
|
40
|
+
off(event: "error" | "trigger" | "timeout", fn: (payload: any) => void): /*elided*/ any;
|
|
41
|
+
};
|
|
42
|
+
export function dontCrash(): {
|
|
43
|
+
/**
|
|
44
|
+
* @template { "error" | "exit" | "sig" | "beforeExit" } E
|
|
45
|
+
* @param { E } event
|
|
46
|
+
* @param { { error: (error: Error | unknown) => void | Promise<void>, exit: (code: number) => void | Promise<void>, sig: (signal: "SIGINT" | "SIGTERM" | "SIGQUIT") => void | Promise<void>, beforeExit: (code: number) => void|Promise<void> }[E] } handler
|
|
47
|
+
*/
|
|
48
|
+
on<E extends "error" | "exit" | "sig" | "beforeExit">(event: E, handler: {
|
|
49
|
+
error: (error: Error | unknown) => void | Promise<void>;
|
|
50
|
+
exit: (code: number) => void | Promise<void>;
|
|
51
|
+
sig: (signal: "SIGINT" | "SIGTERM" | "SIGQUIT") => void | Promise<void>;
|
|
52
|
+
beforeExit: (code: number) => void | Promise<void>;
|
|
53
|
+
}[E]): /*elided*/ any;
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=Utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Utils.d.ts","sourceRoot":"","sources":["../../core/Utils.js"],"names":[],"mappings":"AAQE,yCAGC;AACD;;;;;;;;;;;KAWE;AACF,yBATU,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAUxB;AACD;;;;;;;;KAQE;AACF,gCAPU,OAAO,GAAC,OAAO,CAAC,OAAO,CAAC,WACxB,GAAC,YAET;IAAyB,QAAQ,GAAzB,MAAM;IACgB,OAAO,GAA7B,MAAM,GAAC,IAAI;IACW,GAAG,GAAzB,MAAM,GAAC,IAAI;CAAe;;;IAgGhC;;;aAGA;cAFQ,OAAO,GAAC,SAAS,GAAC,SAAS,MAC3B,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI;IAM9B;;;aAGA;eAFQ,OAAO,GAAC,SAAS,GAAC,SAAS,MAC3B,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI;EASjC;AACD;IAuBI;;;;aAIA;OAHsD,CAAC,SAA3C,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,YAAc,SAC5C,CAAC,WACD;QAAE,KAAK,EAAE,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QAAC,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QAAC,GAAG,EAAE,CAAC,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,SAAS,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QAAC,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAC,OAAO,CAAC,IAAI,CAAC,CAAA;KAAE,CAAC,CAAC,CAAC;EA4BnP"}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
declare const _exports: {
|
|
2
|
+
getEnv(env: any): string;
|
|
3
|
+
wait(ms: number): Promise<void>;
|
|
4
|
+
when(predicate: boolean | Promise<boolean>, handler: any, options?: {
|
|
5
|
+
interval?: number;
|
|
6
|
+
timeout?: number | null;
|
|
7
|
+
max?: number | null;
|
|
8
|
+
}): {
|
|
9
|
+
start(): /*elided*/ any;
|
|
10
|
+
stop(): /*elided*/ any;
|
|
11
|
+
on(event: "error" | "trigger" | "timeout", fn: (payload: any) => void): /*elided*/ any;
|
|
12
|
+
off(event: "error" | "trigger" | "timeout", fn: (payload: any) => void): /*elided*/ any;
|
|
13
|
+
};
|
|
14
|
+
dontCrash(): {
|
|
15
|
+
on<E extends "error" | "exit" | "sig" | "beforeExit">(event: E, handler: {
|
|
16
|
+
error: (error: Error | unknown) => void | Promise<void>;
|
|
17
|
+
exit: (code: number) => void | Promise<void>;
|
|
18
|
+
sig: (signal: "SIGINT" | "SIGTERM" | "SIGQUIT") => void | Promise<void>;
|
|
19
|
+
beforeExit: (code: number) => void | Promise<void>;
|
|
20
|
+
}[E]): /*elided*/ any;
|
|
21
|
+
};
|
|
22
|
+
step(steps: Array<() => void>): {
|
|
23
|
+
currentIndex: number;
|
|
24
|
+
currentStep: () => void;
|
|
25
|
+
next(): /*elided*/ any;
|
|
26
|
+
back(): /*elided*/ any;
|
|
27
|
+
at(index: number): /*elided*/ any;
|
|
28
|
+
ignore(): /*elided*/ any;
|
|
29
|
+
reset(): /*elided*/ any;
|
|
30
|
+
all(): /*elided*/ any;
|
|
31
|
+
};
|
|
32
|
+
log(content: any): this;
|
|
33
|
+
logify(content: any): string;
|
|
34
|
+
group(label: string): this;
|
|
35
|
+
groupEnd(): this;
|
|
36
|
+
setLogger(options?: {
|
|
37
|
+
delimiters?: {
|
|
38
|
+
start?: string;
|
|
39
|
+
end?: string;
|
|
40
|
+
};
|
|
41
|
+
timestamp?: boolean;
|
|
42
|
+
}): this;
|
|
43
|
+
createPath(path?: string): string;
|
|
44
|
+
getFoldersIn(path?: string, recursive?: boolean): string[] | undefined;
|
|
45
|
+
getFolder(path?: string): string | undefined;
|
|
46
|
+
getFilesIn(path?: string, recursive?: boolean): string[] | undefined;
|
|
47
|
+
getFile(path: string): string | undefined;
|
|
48
|
+
createFolder(path: string, force?: boolean): boolean | undefined;
|
|
49
|
+
createFile(path: string, force?: boolean, data?: string | object | null | undefined): boolean | undefined;
|
|
50
|
+
deleteFoldersIn(path?: string, filter?: (folder: string) => boolean): number | undefined;
|
|
51
|
+
deleteFolder(path: string): boolean | undefined;
|
|
52
|
+
deleteFilesIn(path?: string, recursive?: boolean, filter?: (file: string) => boolean): number | undefined;
|
|
53
|
+
deleteFile(path: string): boolean | undefined;
|
|
54
|
+
copyFoldersIn(options: {
|
|
55
|
+
dest: string;
|
|
56
|
+
path?: string;
|
|
57
|
+
recursive?: boolean;
|
|
58
|
+
withFiles?: boolean;
|
|
59
|
+
force?: boolean;
|
|
60
|
+
filter?: (folder: string) => boolean;
|
|
61
|
+
}): number | undefined;
|
|
62
|
+
copyFolder(options: {
|
|
63
|
+
dest: string;
|
|
64
|
+
path?: string;
|
|
65
|
+
recursive?: boolean;
|
|
66
|
+
withFiles?: boolean;
|
|
67
|
+
force?: boolean;
|
|
68
|
+
}): boolean | undefined;
|
|
69
|
+
copyFilesIn(options: {
|
|
70
|
+
dest: string;
|
|
71
|
+
path?: string;
|
|
72
|
+
recursive?: boolean;
|
|
73
|
+
force?: boolean;
|
|
74
|
+
filter?: (file: string) => boolean;
|
|
75
|
+
}): number | undefined;
|
|
76
|
+
copyFile(options: {
|
|
77
|
+
path: string;
|
|
78
|
+
dest: string;
|
|
79
|
+
force?: boolean;
|
|
80
|
+
}): boolean | undefined;
|
|
81
|
+
moveFoldersIn(options: any): number | undefined;
|
|
82
|
+
moveFolder(options: any): boolean | undefined;
|
|
83
|
+
moveFilesIn(options: any): number | undefined;
|
|
84
|
+
moveFile(options: any): boolean | undefined;
|
|
85
|
+
readFile(path: string): string | undefined;
|
|
86
|
+
watch(options?: {
|
|
87
|
+
path?: string;
|
|
88
|
+
recursive?: boolean;
|
|
89
|
+
filter?: (event: string, file: string) => boolean;
|
|
90
|
+
}): any | undefined;
|
|
91
|
+
Storage: {
|
|
92
|
+
new (path?: string): Storage;
|
|
93
|
+
};
|
|
94
|
+
cli_run: (command: string) => NonSharedBuffer & string;
|
|
95
|
+
cli_stream: {
|
|
96
|
+
new (command: any, args: any): {
|
|
97
|
+
"__#private@#processus": import("node:child_process").ChildProcessByStdio<null, import("node:stream").Readable, import("node:stream").Readable>;
|
|
98
|
+
"__#private@#events": import("node:events")<any>;
|
|
99
|
+
on<E extends "data" | "error" | "stopped">(event: E, handler: {
|
|
100
|
+
error: (error: Error) => void | Promise<void>;
|
|
101
|
+
data: (message: string) => void | Promise<void>;
|
|
102
|
+
stopped: (code: number, signal: keyof import("node:child_process").ChildProcessEventMap) => void | Promise<void>;
|
|
103
|
+
}[E]): /*elided*/ any;
|
|
104
|
+
stop(): Promise<any>;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
isArray(value: any): boolean;
|
|
108
|
+
isNumber(value: any): boolean;
|
|
109
|
+
isFunction(value: any): boolean;
|
|
110
|
+
isObject(value: any): boolean;
|
|
111
|
+
isBoolean(value: any): boolean;
|
|
112
|
+
isString(value: any): boolean;
|
|
113
|
+
isUndefined(value: any): boolean;
|
|
114
|
+
isNull(value: any): boolean;
|
|
115
|
+
isDate(value: any): boolean;
|
|
116
|
+
isMap(value: any): boolean;
|
|
117
|
+
isSet(value: any): boolean;
|
|
118
|
+
isError(value: any): boolean;
|
|
119
|
+
};
|
|
120
|
+
export = _exports;
|
|
121
|
+
import Storage = require("./core/Storage");
|
|
122
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.js"],"names":[],"mappings":""}
|