Reference
Classes
SpawnPromise<O, T>
Defined in: index.ts:216
Subtype of Promise returned by promiseSpawn.
Resolution value is inferred from the provided options.
Extends
Promise<SpawnResultByOptions<O> &T>
Type Parameters
| Type Parameter | Default type |
|---|---|
O extends PromiseSpawnOptions | - |
T extends object | object |
Constructors
new SpawnPromise()
new SpawnPromise<O, T>(
command,
args,
opts,
extra): SpawnPromise<O, T>Defined in: index.ts:236
Parameters
| Parameter | Type |
|---|---|
command | string |
args | string[] |
opts | O |
extra | T |
Returns
SpawnPromise<O, T>
Overrides
Promise<SpawnResultByOptions<O> & T>.constructorProperties
| Property | Type | Default value | Description | Overrides |
|---|---|---|---|---|
[toStringTag] | string | 'SpawnPromise' | - | Promise.[toStringTag] |
process | ChildProcessByOptions<O> | undefined | The spawned process this promise references | - |
stdin | O extends PromiseSpawnOptionsNoStdin ? null : Writable | undefined | Expose the child process stdin, if available | - |
Accessors
[species]
Get Signature
get static species: PromiseConstructorDefined in: index.ts:232
Set static Symbol.species back to the base Promise class so that
v8 doesn't get confused by the changed constructor signature.
Returns
PromiseConstructor
Overrides
Promise.[species]Interfaces
PromiseSpawnOptions
Defined in: index.ts:23
Extends
SpawnOptions
Extended by
PromiseSpawnOptionsStringPromiseSpawnOptionsBufferPromiseSpawnOptionsStdinPromiseSpawnOptionsNoStdinPromiseSpawnOptionsStdoutPromiseSpawnOptionsNoStdoutPromiseSpawnOptionsStderrPromiseSpawnOptionsNoStderr
Properties
| Property | Type |
|---|---|
acceptFail? | boolean |
stdioString? | boolean |
PromiseSpawnOptionsBuffer
Defined in: index.ts:30
Extends
Properties
| Property | Type | Overrides | Inherited from |
|---|---|---|---|
acceptFail? | boolean | - | PromiseSpawnOptions.acceptFail |
stdioString | false | PromiseSpawnOptions.stdioString | - |
PromiseSpawnOptionsNoStderr
Defined in: index.ts:92
Extends
Properties
| Property | Type | Description | Overrides | Inherited from |
|---|---|---|---|---|
acceptFail? | boolean | - | - | PromiseSpawnOptions.acceptFail |
stdio | | IOTypeNoPipe | IOTypeNoPipe[] | [number | IOType | "ipc" | Stream | null | undefined, number | IOType | "ipc" | Stream | null | undefined, IOTypeNoPipe] | Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings. If passed as an array, the first element is used for stdin, the second for stdout, and the third for stderr. A fourth element can be used to specify the stdio behavior beyond the standard streams. See ChildProcess.stdio for more information. Default 'pipe' | PromiseSpawnOptions.stdio | - |
stdioString? | boolean | - | - | PromiseSpawnOptions.stdioString |
PromiseSpawnOptionsNoStdin
Defined in: index.ts:42
Extends
Properties
| Property | Type | Description | Overrides | Inherited from |
|---|---|---|---|---|
acceptFail? | boolean | - | - | PromiseSpawnOptions.acceptFail |
stdio | | IOTypeNoPipe | IOTypeNoPipe[] | [number | IOTypeNoPipe, number | IOType | "ipc" | Stream | null | undefined, number | IOType | "ipc" | Stream | null | undefined] | Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings. If passed as an array, the first element is used for stdin, the second for stdout, and the third for stderr. A fourth element can be used to specify the stdio behavior beyond the standard streams. See ChildProcess.stdio for more information. Default 'pipe' | PromiseSpawnOptions.stdio | - |
stdioString? | boolean | - | - | PromiseSpawnOptions.stdioString |
PromiseSpawnOptionsNoStdout
Defined in: index.ts:67
Extends
Properties
| Property | Type | Description | Overrides | Inherited from |
|---|---|---|---|---|
acceptFail? | boolean | - | - | PromiseSpawnOptions.acceptFail |
stdio | | IOTypeNoPipe | IOTypeNoPipe[] | [number | IOType | "ipc" | Stream | null | undefined, IOTypeNoPipe | undefined, number | IOType | "ipc" | Stream | null | undefined] | Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings. If passed as an array, the first element is used for stdin, the second for stdout, and the third for stderr. A fourth element can be used to specify the stdio behavior beyond the standard streams. See ChildProcess.stdio for more information. Default 'pipe' | PromiseSpawnOptions.stdio | - |
stdioString? | boolean | - | - | PromiseSpawnOptions.stdioString |
PromiseSpawnOptionsStderr
Defined in: index.ts:77
Extends
Extended by
Properties
| Property | Type | Description | Overrides | Inherited from |
|---|---|---|---|---|
acceptFail? | boolean | - | - | PromiseSpawnOptions.acceptFail |
stdio? | | "overlapped" | "pipe" | [null | number | IOType | "ipc" | Stream, null | number | IOType | "ipc" | Stream, IOTypePipe] | Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings. If passed as an array, the first element is used for stdin, the second for stdout, and the third for stderr. A fourth element can be used to specify the stdio behavior beyond the standard streams. See ChildProcess.stdio for more information. Default 'pipe' | PromiseSpawnOptions.stdio | - |
stdioString? | boolean | - | - | PromiseSpawnOptions.stdioString |
PromiseSpawnOptionsStderrBuffer
Defined in: index.ts:89
Extends
Properties
| Property | Type | Description | Overrides | Inherited from |
|---|---|---|---|---|
acceptFail? | boolean | - | - | PromiseSpawnOptionsStderr.acceptFail |
stdio? | | "overlapped" | "pipe" | [null | number | IOType | "ipc" | Stream, null | number | IOType | "ipc" | Stream, IOTypePipe] | Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings. If passed as an array, the first element is used for stdin, the second for stdout, and the third for stderr. A fourth element can be used to specify the stdio behavior beyond the standard streams. See ChildProcess.stdio for more information. Default 'pipe' | - | PromiseSpawnOptionsStderr.stdio |
stdioString | false | - | PromiseSpawnOptionsStderr.stdioString | - |
PromiseSpawnOptionsStderrString
Defined in: index.ts:86
Extends
Properties
| Property | Type | Description | Overrides | Inherited from |
|---|---|---|---|---|
acceptFail? | boolean | - | - | PromiseSpawnOptionsStderr.acceptFail |
stdio? | | "overlapped" | "pipe" | [null | number | IOType | "ipc" | Stream, null | number | IOType | "ipc" | Stream, IOTypePipe] | Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings. If passed as an array, the first element is used for stdin, the second for stdout, and the third for stderr. A fourth element can be used to specify the stdio behavior beyond the standard streams. See ChildProcess.stdio for more information. Default 'pipe' | - | PromiseSpawnOptionsStderr.stdio |
stdioString? | true | - | PromiseSpawnOptionsStderr.stdioString | - |
PromiseSpawnOptionsStdin
Defined in: index.ts:33
Extends
Properties
| Property | Type | Description | Overrides | Inherited from |
|---|---|---|---|---|
acceptFail? | boolean | - | - | PromiseSpawnOptions.acceptFail |
stdio? | | "overlapped" | "pipe" | [IOTypePipe, null | number | IOType | "ipc" | Stream, null | number | IOType | "ipc" | Stream] | Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings. If passed as an array, the first element is used for stdin, the second for stdout, and the third for stderr. A fourth element can be used to specify the stdio behavior beyond the standard streams. See ChildProcess.stdio for more information. Default 'pipe' | PromiseSpawnOptions.stdio | - |
stdioString? | boolean | - | - | PromiseSpawnOptions.stdioString |
PromiseSpawnOptionsStdout
Defined in: index.ts:52
Extends
Extended by
Properties
| Property | Type | Description | Overrides | Inherited from |
|---|---|---|---|---|
acceptFail? | boolean | - | - | PromiseSpawnOptions.acceptFail |
stdio? | | "overlapped" | "pipe" | [null | number | IOType | "ipc" | Stream, IOTypePipe, null | number | IOType | "ipc" | Stream] | Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings. If passed as an array, the first element is used for stdin, the second for stdout, and the third for stderr. A fourth element can be used to specify the stdio behavior beyond the standard streams. See ChildProcess.stdio for more information. Default 'pipe' | PromiseSpawnOptions.stdio | - |
stdioString? | boolean | - | - | PromiseSpawnOptions.stdioString |
PromiseSpawnOptionsStdoutBuffer
Defined in: index.ts:64
Extends
Properties
| Property | Type | Description | Overrides | Inherited from |
|---|---|---|---|---|
acceptFail? | boolean | - | - | PromiseSpawnOptionsStdout.acceptFail |
stdio? | | "overlapped" | "pipe" | [null | number | IOType | "ipc" | Stream, IOTypePipe, null | number | IOType | "ipc" | Stream] | Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings. If passed as an array, the first element is used for stdin, the second for stdout, and the third for stderr. A fourth element can be used to specify the stdio behavior beyond the standard streams. See ChildProcess.stdio for more information. Default 'pipe' | - | PromiseSpawnOptionsStdout.stdio |
stdioString | false | - | PromiseSpawnOptionsStdout.stdioString | - |
PromiseSpawnOptionsStdoutString
Defined in: index.ts:61
Extends
Properties
| Property | Type | Description | Overrides | Inherited from |
|---|---|---|---|---|
acceptFail? | boolean | - | - | PromiseSpawnOptionsStdout.acceptFail |
stdio? | | "overlapped" | "pipe" | [null | number | IOType | "ipc" | Stream, IOTypePipe, null | number | IOType | "ipc" | Stream] | Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings. If passed as an array, the first element is used for stdin, the second for stdout, and the third for stderr. A fourth element can be used to specify the stdio behavior beyond the standard streams. See ChildProcess.stdio for more information. Default 'pipe' | - | PromiseSpawnOptionsStdout.stdio |
stdioString? | true | - | PromiseSpawnOptionsStdout.stdioString | - |
PromiseSpawnOptionsString
Defined in: index.ts:27
Extends
Properties
| Property | Type | Overrides | Inherited from |
|---|---|---|---|
acceptFail? | boolean | - | PromiseSpawnOptions.acceptFail |
stdioString? | true | PromiseSpawnOptions.stdioString | - |
SpawnResult
Defined in: index.ts:123
Extended by
SpawnResultStringSpawnResultBufferSpawnResultStdoutSpawnResultNoStdoutSpawnResultStderrSpawnResultNoStderrSpawnResultNoStdioSpawnResultStdioStringsSpawnResultStdioBuffers
Properties
| Property | Type |
|---|---|
args | string[] |
command | string |
cwd | string |
signal | null | Signals |
status | null | number |
stderr | null | string | Buffer<ArrayBufferLike> |
stdout | null | string | Buffer<ArrayBufferLike> |
SpawnResultBuffer
Defined in: index.ts:136
Extends
Extended by
Properties
| Property | Type | Overrides | Inherited from |
|---|---|---|---|
args | string[] | - | SpawnResult.args |
command | string | - | SpawnResult.command |
cwd | string | - | SpawnResult.cwd |
signal | null | Signals | - | SpawnResult.signal |
status | null | number | - | SpawnResult.status |
stderr | null | Buffer<ArrayBufferLike> | SpawnResult.stderr | - |
stdout | null | Buffer<ArrayBufferLike> | SpawnResult.stdout | - |
SpawnResultNoStderr
Defined in: index.ts:161
Extends
Properties
| Property | Type | Overrides | Inherited from |
|---|---|---|---|
args | string[] | - | SpawnResult.args |
command | string | - | SpawnResult.command |
cwd | string | - | SpawnResult.cwd |
signal | null | Signals | - | SpawnResult.signal |
status | null | number | - | SpawnResult.status |
stderr | null | SpawnResult.stderr | - |
stdout | null | string | Buffer<ArrayBufferLike> | - | SpawnResult.stdout |
SpawnResultNoStdio
Defined in: index.ts:164
Extends
Properties
| Property | Type | Overrides | Inherited from |
|---|---|---|---|
args | string[] | - | SpawnResult.args |
command | string | - | SpawnResult.command |
cwd | string | - | SpawnResult.cwd |
signal | null | Signals | - | SpawnResult.signal |
status | null | number | - | SpawnResult.status |
stderr | null | SpawnResult.stderr | - |
stdout | null | SpawnResult.stdout | - |
SpawnResultNoStdout
Defined in: index.ts:149
Extends
Properties
| Property | Type | Overrides | Inherited from |
|---|---|---|---|
args | string[] | - | SpawnResult.args |
command | string | - | SpawnResult.command |
cwd | string | - | SpawnResult.cwd |
signal | null | Signals | - | SpawnResult.signal |
status | null | number | - | SpawnResult.status |
stderr | null | string | Buffer<ArrayBufferLike> | - | SpawnResult.stderr |
stdout | null | SpawnResult.stdout | - |
SpawnResultStderr
Defined in: index.ts:152
Extends
Properties
| Property | Type | Overrides | Inherited from |
|---|---|---|---|
args | string[] | - | SpawnResult.args |
command | string | - | SpawnResult.command |
cwd | string | - | SpawnResult.cwd |
signal | null | Signals | - | SpawnResult.signal |
status | null | number | - | SpawnResult.status |
stderr | string | Buffer<ArrayBufferLike> | SpawnResult.stderr | - |
stdout | null | string | Buffer<ArrayBufferLike> | - | SpawnResult.stdout |
SpawnResultStderrBuffer
Defined in: index.ts:158
Extends
Properties
| Property | Type | Overrides | Inherited from |
|---|---|---|---|
args | string[] | - | SpawnResultBuffer.args |
command | string | - | SpawnResultBuffer.command |
cwd | string | - | SpawnResultBuffer.cwd |
signal | null | Signals | - | SpawnResultBuffer.signal |
status | null | number | - | SpawnResultBuffer.status |
stderr | Buffer | SpawnResultBuffer.stderr | - |
stdout | null | Buffer<ArrayBufferLike> | - | SpawnResultBuffer.stdout |
SpawnResultStderrString
Defined in: index.ts:155
Extends
Properties
| Property | Type | Overrides | Inherited from |
|---|---|---|---|
args | string[] | - | SpawnResultString.args |
command | string | - | SpawnResultString.command |
cwd | string | - | SpawnResultString.cwd |
signal | null | Signals | - | SpawnResultString.signal |
status | null | number | - | SpawnResultString.status |
stderr | string | SpawnResultString.stderr | - |
stdout | null | string | - | SpawnResultString.stdout |
SpawnResultStdioBuffers
Defined in: index.ts:172
Extends
Properties
| Property | Type | Overrides | Inherited from |
|---|---|---|---|
args | string[] | - | SpawnResult.args |
command | string | - | SpawnResult.command |
cwd | string | - | SpawnResult.cwd |
signal | null | Signals | - | SpawnResult.signal |
status | null | number | - | SpawnResult.status |
stderr | Buffer | SpawnResult.stderr | - |
stdout | Buffer | SpawnResult.stdout | - |
SpawnResultStdioStrings
Defined in: index.ts:168
Extends
Properties
| Property | Type | Overrides | Inherited from |
|---|---|---|---|
args | string[] | - | SpawnResult.args |
command | string | - | SpawnResult.command |
cwd | string | - | SpawnResult.cwd |
signal | null | Signals | - | SpawnResult.signal |
status | null | number | - | SpawnResult.status |
stderr | string | SpawnResult.stderr | - |
stdout | string | SpawnResult.stdout | - |
SpawnResultStdout
Defined in: index.ts:140
Extends
Properties
| Property | Type | Overrides | Inherited from |
|---|---|---|---|
args | string[] | - | SpawnResult.args |
command | string | - | SpawnResult.command |
cwd | string | - | SpawnResult.cwd |
signal | null | Signals | - | SpawnResult.signal |
status | null | number | - | SpawnResult.status |
stderr | null | string | Buffer<ArrayBufferLike> | - | SpawnResult.stderr |
stdout | string | Buffer<ArrayBufferLike> | SpawnResult.stdout | - |
SpawnResultStdoutBuffer
Defined in: index.ts:146
Extends
Properties
| Property | Type | Overrides | Inherited from |
|---|---|---|---|
args | string[] | - | SpawnResultBuffer.args |
command | string | - | SpawnResultBuffer.command |
cwd | string | - | SpawnResultBuffer.cwd |
signal | null | Signals | - | SpawnResultBuffer.signal |
status | null | number | - | SpawnResultBuffer.status |
stderr | null | Buffer<ArrayBufferLike> | - | SpawnResultBuffer.stderr |
stdout | Buffer | SpawnResultBuffer.stdout | - |
SpawnResultStdoutString
Defined in: index.ts:143
Extends
Properties
| Property | Type | Overrides | Inherited from |
|---|---|---|---|
args | string[] | - | SpawnResultString.args |
command | string | - | SpawnResultString.command |
cwd | string | - | SpawnResultString.cwd |
signal | null | Signals | - | SpawnResultString.signal |
status | null | number | - | SpawnResultString.status |
stderr | null | string | - | SpawnResultString.stderr |
stdout | string | SpawnResultString.stdout | - |
SpawnResultString
Defined in: index.ts:132
Extends
Extended by
Properties
| Property | Type | Overrides | Inherited from |
|---|---|---|---|
args | string[] | - | SpawnResult.args |
command | string | - | SpawnResult.command |
cwd | string | - | SpawnResult.cwd |
signal | null | Signals | - | SpawnResult.signal |
status | null | number | - | SpawnResult.status |
stderr | null | string | SpawnResult.stderr | - |
stdout | null | string | SpawnResult.stdout | - |
Type Aliases
ChildProcessByOptions<T>
type ChildProcessByOptions<T> = Override<ChildProcess, {
stderr: T extends PromiseSpawnOptionsNoStderr ? null : Exclude<ChildProcess["stderr"], null>;
stdin: T extends PromiseSpawnOptionsNoStdin ? null : Exclude<ChildProcess["stdin"], null>;
stdout: T extends PromiseSpawnOptionsNoStdout ? null : Exclude<ChildProcess["stdout"], null>;
}>;Defined in: index.ts:198
Type Parameters
| Type Parameter |
|---|
T extends PromiseSpawnOptions |
IOTypeNoPipe
type IOTypeNoPipe = Exclude<IOType, IOTypePipe>;Defined in: index.ts:20
IOTypePipe
type IOTypePipe = "overlapped" | "pipe" | null | undefined;Defined in: index.ts:21
Override<T, R>
type Override<T, R> = Omit<T, keyof R> & R;Defined in: index.ts:177
Type Parameters
| Type Parameter |
|---|
T |
R |
SpawnResultByOptions<T>
type SpawnResultByOptions<T> = Override<SpawnResult, {
stderr: T extends PromiseSpawnOptionsNoStderr ? null : T extends PromiseSpawnOptionsStderrBuffer ? Buffer : T extends PromiseSpawnOptionsStderrString ? string : T extends PromiseSpawnOptionsBuffer ? Buffer | null : T extends PromiseSpawnOptionsString ? string | null : Buffer | string | null;
stdout: T extends PromiseSpawnOptionsNoStdout ? null : T extends PromiseSpawnOptionsStdoutBuffer ? Buffer : T extends PromiseSpawnOptionsStdoutString ? string : T extends PromiseSpawnOptionsBuffer ? Buffer | null : T extends PromiseSpawnOptionsString ? string | null : Buffer | string | null;
}>;Defined in: index.ts:179
Type Parameters
| Type Parameter |
|---|
T extends PromiseSpawnOptions |
Functions
promiseSpawn()
function promiseSpawn<O, E>(
command,
args,
opts,
extra): SpawnPromise<O, E>Defined in: index.ts:316
Spawn the specified command, and return a promise that resolves when the process closes or has an error.
Type Parameters
| Type Parameter | Default type |
|---|---|
O extends PromiseSpawnOptions | PromiseSpawnOptionsStderrString & PromiseSpawnOptionsStdoutString |
E extends object | object |
Parameters
| Parameter | Type |
|---|---|
command | string |
args | string[] |
opts | O |
extra | E |
Returns
SpawnPromise<O, E>