@goodbyenjn/utils 26.3.0 → 26.4.1
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/README.md +131 -66
- package/dist/chunks/{chunk-5ed3bc8a.js → chunk-11b9216b.js} +218 -351
- package/dist/chunks/chunk-1b381080.js +25 -0
- package/dist/chunks/chunk-3c6f28c7.d.ts +39 -0
- package/dist/chunks/chunk-3ce2ea14.js +36 -0
- package/dist/chunks/chunk-71e0c144.d.ts +168 -0
- package/dist/chunks/chunk-9fe6b612.d.ts +10 -0
- package/dist/chunks/chunk-bd9f56dd.d.ts +175 -0
- package/dist/common.d.ts +2 -195
- package/dist/common.js +2 -3
- package/dist/exec.d.ts +129 -0
- package/dist/exec.js +759 -0
- package/dist/fs.d.ts +422 -98
- package/dist/fs.js +999 -876
- package/dist/global-types.d.ts +146 -58
- package/dist/json.d.ts +29 -0
- package/dist/json.js +3 -0
- package/dist/remeda.d.ts +12 -12288
- package/dist/remeda.js +2 -3
- package/dist/result.d.ts +2 -2
- package/dist/result.js +2 -3
- package/dist/types.d.ts +3 -2
- package/dist/types.js +1 -1
- package/package.json +27 -18
- package/dist/chunks/chunk-b970a8d0.js +0 -2782
- package/dist/chunks/chunk-d1860346.d.ts +0 -154
- package/dist/chunks/chunk-e931fe39.d.ts +0 -11978
- package/dist/shell.d.ts +0 -111
- package/dist/shell.js +0 -781
package/dist/shell.d.ts
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
import { ChildProcess, SpawnOptions } from "node:child_process";
|
|
3
|
-
import { Readable } from "node:stream";
|
|
4
|
-
|
|
5
|
-
//#region node_modules/.pnpm/tinyexec@1.0.2/node_modules/tinyexec/dist/main.d.ts
|
|
6
|
-
|
|
7
|
-
//#region src/non-zero-exit-error.d.ts
|
|
8
|
-
declare class NonZeroExitError extends Error {
|
|
9
|
-
readonly result: Result;
|
|
10
|
-
readonly output?: Output;
|
|
11
|
-
get exitCode(): number | undefined;
|
|
12
|
-
constructor(result: Result, output?: Output);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
//#endregion
|
|
16
|
-
//#region src/main.d.ts
|
|
17
|
-
interface Output {
|
|
18
|
-
stderr: string;
|
|
19
|
-
stdout: string;
|
|
20
|
-
exitCode: number | undefined;
|
|
21
|
-
}
|
|
22
|
-
interface PipeOptions extends Options {}
|
|
23
|
-
type KillSignal = Parameters<ChildProcess['kill']>[0];
|
|
24
|
-
interface OutputApi extends AsyncIterable<string> {
|
|
25
|
-
pipe(command: string, args?: string[], options?: Partial<PipeOptions>): Result;
|
|
26
|
-
process: ChildProcess | undefined;
|
|
27
|
-
kill(signal?: KillSignal): boolean;
|
|
28
|
-
get pid(): number | undefined;
|
|
29
|
-
get aborted(): boolean;
|
|
30
|
-
get killed(): boolean;
|
|
31
|
-
get exitCode(): number | undefined;
|
|
32
|
-
}
|
|
33
|
-
type Result = PromiseLike<Output> & OutputApi;
|
|
34
|
-
interface Options {
|
|
35
|
-
signal: AbortSignal;
|
|
36
|
-
nodeOptions: SpawnOptions;
|
|
37
|
-
timeout: number;
|
|
38
|
-
persist: boolean;
|
|
39
|
-
stdin: ExecProcess;
|
|
40
|
-
throwOnError: boolean;
|
|
41
|
-
}
|
|
42
|
-
declare class ExecProcess implements Result {
|
|
43
|
-
protected _process?: ChildProcess;
|
|
44
|
-
protected _aborted: boolean;
|
|
45
|
-
protected _options: Partial<Options>;
|
|
46
|
-
protected _command: string;
|
|
47
|
-
protected _args: string[];
|
|
48
|
-
protected _resolveClose?: () => void;
|
|
49
|
-
protected _processClosed: Promise<void>;
|
|
50
|
-
protected _thrownError?: Error;
|
|
51
|
-
get process(): ChildProcess | undefined;
|
|
52
|
-
get pid(): number | undefined;
|
|
53
|
-
get exitCode(): number | undefined;
|
|
54
|
-
constructor(command: string, args?: string[], options?: Partial<Options>);
|
|
55
|
-
kill(signal?: KillSignal): boolean;
|
|
56
|
-
get aborted(): boolean;
|
|
57
|
-
get killed(): boolean;
|
|
58
|
-
pipe(command: string, args?: string[], options?: Partial<PipeOptions>): Result;
|
|
59
|
-
[Symbol.asyncIterator](): AsyncIterator<string>;
|
|
60
|
-
protected _waitForOutput(): Promise<Output>;
|
|
61
|
-
then<TResult1 = Output, TResult2 = never>(onfulfilled?: ((value: Output) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
|
|
62
|
-
protected _streamOut?: Readable;
|
|
63
|
-
protected _streamErr?: Readable;
|
|
64
|
-
spawn(): void;
|
|
65
|
-
protected _resetState(): void;
|
|
66
|
-
protected _onError: (err: Error) => void;
|
|
67
|
-
protected _onClose: () => void;
|
|
68
|
-
}
|
|
69
|
-
//#endregion
|
|
70
|
-
//#region src/shell/types.d.ts
|
|
71
|
-
interface StringOrTemplateFunction {
|
|
72
|
-
(command: string): ShellResult;
|
|
73
|
-
(template: TemplateStringsArray, ...values: any[]): ShellResult;
|
|
74
|
-
}
|
|
75
|
-
interface ShellExec {
|
|
76
|
-
(command: string, args?: string[], options?: Partial<PipeOptions>): ShellResult;
|
|
77
|
-
(template: TemplateStringsArray, ...values: any[]): ShellResult;
|
|
78
|
-
(options: Partial<Options>): StringOrTemplateFunction;
|
|
79
|
-
}
|
|
80
|
-
interface ShellOutputApi extends OutputApi {
|
|
81
|
-
pipe: ShellExec;
|
|
82
|
-
}
|
|
83
|
-
type ShellResult = PromiseLike<Output> & ShellOutputApi;
|
|
84
|
-
//#endregion
|
|
85
|
-
//#region src/shell/exec.d.ts
|
|
86
|
-
declare class ShellExecProcess extends ExecProcess implements ShellResult {
|
|
87
|
-
constructor(command: string, args?: string[], options?: Partial<Options>);
|
|
88
|
-
pipe(command: string, args?: string[], options?: Partial<PipeOptions>): ShellResult;
|
|
89
|
-
pipe(template: TemplateStringsArray, ...values: any[]): ShellResult;
|
|
90
|
-
pipe(options: Partial<Options>): StringOrTemplateFunction;
|
|
91
|
-
[Symbol.asyncIterator](): AsyncIterator<string>;
|
|
92
|
-
protected _waitForOutput(): Promise<Output>;
|
|
93
|
-
}
|
|
94
|
-
declare const exec: ShellExec;
|
|
95
|
-
//#endregion
|
|
96
|
-
//#region src/shell/error.d.ts
|
|
97
|
-
declare class ShellNonZeroExitError extends NonZeroExitError {
|
|
98
|
-
readonly result: ShellResult;
|
|
99
|
-
constructor(result: ShellResult, output?: Output);
|
|
100
|
-
}
|
|
101
|
-
//#endregion
|
|
102
|
-
//#region node_modules/.pnpm/args-tokenizer@0.3.0/node_modules/args-tokenizer/dist/args-tokenizer.d.ts
|
|
103
|
-
type Options$1 = {
|
|
104
|
-
loose?: boolean;
|
|
105
|
-
};
|
|
106
|
-
/**
|
|
107
|
-
* Tokenize a shell string into argv array
|
|
108
|
-
*/
|
|
109
|
-
declare const tokenizeArgs: (argsString: string, options?: Options$1) => string[];
|
|
110
|
-
//#endregion
|
|
111
|
-
export { exec as $, exec, exec as x, type ShellExec, ShellExecProcess, type KillSignal as ShellKillSignal, ShellNonZeroExitError, type Options as ShellOptions, type Output as ShellOutput, type ShellOutputApi, type PipeOptions as ShellPipeOptions, type ShellResult, tokenizeArgs as splitShellCommand };
|