@vltpkg/promise-spawn
Classes
SpawnPromise<O, T>
Defined in: index.ts:229
Subtype of Promise returned by promiseSpawn.
Resolution value is inferred from the provided options.
Extends
Promise<SpawnResultByOptions<O> &T>
Type Parameters
• 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:249
Parameters
command
string
args
string[]
opts
O
extra
T = ...
Returns
SpawnPromise<O, T>
Overrides
Promise<SpawnResultByOptions<O> & T>.constructorProperties
[toStringTag]
[toStringTag]: string = 'SpawnPromise';Defined in: index.ts:233
Overrides
Promise.[toStringTag]process
process: ChildProcessByOptions<O>Defined in: index.ts:236
The spawned process this promise references
stdin
stdin: O extends PromiseSpawnOptionsNoStdin ? null : Writable;Defined in: index.ts:239
Expose the child process stdin, if available
Accessors
[species]
Get Signature
get static species: PromiseConstructorDefined in: index.ts:245
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:24
Extends
SpawnOptions
Extended by
PromiseSpawnOptionsStringPromiseSpawnOptionsBufferPromiseSpawnOptionsStdinPromiseSpawnOptionsNoStdinPromiseSpawnOptionsStdoutPromiseSpawnOptionsNoStdoutPromiseSpawnOptionsStderrPromiseSpawnOptionsNoStderr
Properties
acceptFail?
optional acceptFail: boolean;Defined in: index.ts:26
stdioString?
optional stdioString: boolean;Defined in: index.ts:25
PromiseSpawnOptionsBuffer
Defined in: index.ts:32
Extends
Properties
acceptFail?
optional acceptFail: boolean;Defined in: index.ts:26
Inherited from
PromiseSpawnOptions.acceptFail
stdioString
stdioString: falseDefined in: index.ts:34
Overrides
PromiseSpawnOptions.stdioString
PromiseSpawnOptionsNoStderr
Defined in: index.ts:104
Extends
Properties
acceptFail?
optional acceptFail: boolean;Defined in: index.ts:26
Inherited from
PromiseSpawnOptions.acceptFail
stdio
stdio: | IOTypeNoPipe | IOTypeNoPipe[] | [number | IOType | "ipc" | Stream | null | undefined, number | IOType | "ipc" | Stream | null | undefined, IOTypeNoPipe];Defined in: index.ts:106
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'Overrides
PromiseSpawnOptions.stdiostdioString?
optional stdioString: boolean;Defined in: index.ts:25
Inherited from
PromiseSpawnOptions.stdioString
PromiseSpawnOptionsNoStdin
Defined in: index.ts:46
Extends
Properties
acceptFail?
optional acceptFail: boolean;Defined in: index.ts:26
Inherited from
PromiseSpawnOptions.acceptFail
stdio
stdio: | IOTypeNoPipe | IOTypeNoPipe[] | [number | IOTypeNoPipe, number | IOType | "ipc" | Stream | null | undefined, number | IOType | "ipc" | Stream | null | undefined];Defined in: index.ts:48
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'Overrides
PromiseSpawnOptions.stdiostdioString?
optional stdioString: boolean;Defined in: index.ts:25
Inherited from
PromiseSpawnOptions.stdioString
PromiseSpawnOptionsNoStdout
Defined in: index.ts:75
Extends
Properties
acceptFail?
optional acceptFail: boolean;Defined in: index.ts:26
Inherited from
PromiseSpawnOptions.acceptFail
stdio
stdio: | IOTypeNoPipe | IOTypeNoPipe[] | [number | IOType | "ipc" | Stream | null | undefined, IOTypeNoPipe | undefined, number | IOType | "ipc" | Stream | null | undefined];Defined in: index.ts:77
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'Overrides
PromiseSpawnOptions.stdiostdioString?
optional stdioString: boolean;Defined in: index.ts:25
Inherited from
PromiseSpawnOptions.stdioString
PromiseSpawnOptionsStderr
Defined in: index.ts:86
Extends
Extended by
Properties
acceptFail?
optional acceptFail: boolean;Defined in: index.ts:26
Inherited from
PromiseSpawnOptions.acceptFail
stdio?
optional stdio: | "overlapped" | "pipe" | [null | number | IOType | "ipc" | Stream, null | number | IOType | "ipc" | Stream, IOTypePipe];Defined in: index.ts:88
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'Overrides
PromiseSpawnOptions.stdiostdioString?
optional stdioString: boolean;Defined in: index.ts:25
Inherited from
PromiseSpawnOptions.stdioString
PromiseSpawnOptionsStderrBuffer
Defined in: index.ts:100
Extends
Properties
acceptFail?
optional acceptFail: boolean;Defined in: index.ts:26
Inherited from
PromiseSpawnOptionsStderr.acceptFail
stdio?
optional stdio: | "overlapped" | "pipe" | [null | number | IOType | "ipc" | Stream, null | number | IOType | "ipc" | Stream, IOTypePipe];Defined in: index.ts:88
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'Inherited from
PromiseSpawnOptionsStderr.stdio
stdioString
stdioString: falseDefined in: index.ts:102
Overrides
PromiseSpawnOptionsStderr.stdioString
PromiseSpawnOptionsStderrString
Defined in: index.ts:96
Extends
Properties
acceptFail?
optional acceptFail: boolean;Defined in: index.ts:26
Inherited from
PromiseSpawnOptionsStderr.acceptFail
stdio?
optional stdio: | "overlapped" | "pipe" | [null | number | IOType | "ipc" | Stream, null | number | IOType | "ipc" | Stream, IOTypePipe];Defined in: index.ts:88
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'Inherited from
PromiseSpawnOptionsStderr.stdio
stdioString?
optional stdioString: true;Defined in: index.ts:98
Overrides
PromiseSpawnOptionsStderr.stdioString
PromiseSpawnOptionsStdin
Defined in: index.ts:36
Extends
Properties
acceptFail?
optional acceptFail: boolean;Defined in: index.ts:26
Inherited from
PromiseSpawnOptions.acceptFail
stdio?
optional stdio: | "overlapped" | "pipe" | [IOTypePipe, null | number | IOType | "ipc" | Stream, null | number | IOType | "ipc" | Stream];Defined in: index.ts:38
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'Overrides
PromiseSpawnOptions.stdiostdioString?
optional stdioString: boolean;Defined in: index.ts:25
Inherited from
PromiseSpawnOptions.stdioString
PromiseSpawnOptionsStdout
Defined in: index.ts:57
Extends
Extended by
Properties
acceptFail?
optional acceptFail: boolean;Defined in: index.ts:26
Inherited from
PromiseSpawnOptions.acceptFail
stdio?
optional stdio: | "overlapped" | "pipe" | [null | number | IOType | "ipc" | Stream, IOTypePipe, null | number | IOType | "ipc" | Stream];Defined in: index.ts:59
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'Overrides
PromiseSpawnOptions.stdiostdioString?
optional stdioString: boolean;Defined in: index.ts:25
Inherited from
PromiseSpawnOptions.stdioString
PromiseSpawnOptionsStdoutBuffer
Defined in: index.ts:71
Extends
Properties
acceptFail?
optional acceptFail: boolean;Defined in: index.ts:26
Inherited from
PromiseSpawnOptionsStdout.acceptFail
stdio?
optional stdio: | "overlapped" | "pipe" | [null | number | IOType | "ipc" | Stream, IOTypePipe, null | number | IOType | "ipc" | Stream];Defined in: index.ts:59
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'Inherited from
PromiseSpawnOptionsStdout.stdio
stdioString
stdioString: falseDefined in: index.ts:73
Overrides
PromiseSpawnOptionsStdout.stdioString
PromiseSpawnOptionsStdoutString
Defined in: index.ts:67
Extends
Properties
acceptFail?
optional acceptFail: boolean;Defined in: index.ts:26
Inherited from
PromiseSpawnOptionsStdout.acceptFail
stdio?
optional stdio: | "overlapped" | "pipe" | [null | number | IOType | "ipc" | Stream, IOTypePipe, null | number | IOType | "ipc" | Stream];Defined in: index.ts:59
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'Inherited from
PromiseSpawnOptionsStdout.stdio
stdioString?
optional stdioString: true;Defined in: index.ts:69
Overrides
PromiseSpawnOptionsStdout.stdioString
PromiseSpawnOptionsString
Defined in: index.ts:28
Extends
Properties
acceptFail?
optional acceptFail: boolean;Defined in: index.ts:26
Inherited from
PromiseSpawnOptions.acceptFail
stdioString?
optional stdioString: true;Defined in: index.ts:30
Overrides
PromiseSpawnOptions.stdioString
SpawnResult
Defined in: index.ts:136
Extended by
SpawnResultStringSpawnResultBufferSpawnResultStdoutSpawnResultNoStdoutSpawnResultStderrSpawnResultNoStderrSpawnResultNoStdioSpawnResultStdioStringsSpawnResultStdioBuffers
Properties
args
args: string[];Defined in: index.ts:138
command
command: stringDefined in: index.ts:137
cwd
cwd: stringDefined in: index.ts:139
signal
signal: null | SignalsDefined in: index.ts:141
status
status: null | numberDefined in: index.ts:140
stderr
stderr: null | string | Buffer<ArrayBufferLike>Defined in: index.ts:143
stdout
stdout: null | string | Buffer<ArrayBufferLike>Defined in: index.ts:142
SpawnResultBuffer
Defined in: index.ts:149
Extends
Extended by
Properties
args
args: string[];Defined in: index.ts:138
Inherited from
command
command: stringDefined in: index.ts:137
Inherited from
cwd
cwd: stringDefined in: index.ts:139
Inherited from
signal
signal: null | SignalsDefined in: index.ts:141
Inherited from
status
status: null | numberDefined in: index.ts:140
Inherited from
stderr
stderr: null | Buffer<ArrayBufferLike>Defined in: index.ts:151
Overrides
stdout
stdout: null | Buffer<ArrayBufferLike>Defined in: index.ts:150
Overrides
SpawnResultNoStderr
Defined in: index.ts:174
Extends
Properties
args
args: string[];Defined in: index.ts:138
Inherited from
command
command: stringDefined in: index.ts:137
Inherited from
cwd
cwd: stringDefined in: index.ts:139
Inherited from
signal
signal: null | SignalsDefined in: index.ts:141
Inherited from
status
status: null | numberDefined in: index.ts:140
Inherited from
stderr
stderr: nullDefined in: index.ts:175
Overrides
stdout
stdout: null | string | Buffer<ArrayBufferLike>Defined in: index.ts:142
Inherited from
SpawnResultNoStdio
Defined in: index.ts:177
Extends
Properties
args
args: string[];Defined in: index.ts:138
Inherited from
command
command: stringDefined in: index.ts:137
Inherited from
cwd
cwd: stringDefined in: index.ts:139
Inherited from
signal
signal: null | SignalsDefined in: index.ts:141
Inherited from
status
status: null | numberDefined in: index.ts:140
Inherited from
stderr
stderr: nullDefined in: index.ts:178
Overrides
stdout
stdout: nullDefined in: index.ts:179
Overrides
SpawnResultNoStdout
Defined in: index.ts:162
Extends
Properties
args
args: string[];Defined in: index.ts:138
Inherited from
command
command: stringDefined in: index.ts:137
Inherited from
cwd
cwd: stringDefined in: index.ts:139
Inherited from
signal
signal: null | SignalsDefined in: index.ts:141
Inherited from
status
status: null | numberDefined in: index.ts:140
Inherited from
stderr
stderr: null | string | Buffer<ArrayBufferLike>Defined in: index.ts:143
Inherited from
stdout
stdout: nullDefined in: index.ts:163
Overrides
SpawnResultStderr
Defined in: index.ts:165
Extends
Properties
args
args: string[];Defined in: index.ts:138
Inherited from
command
command: stringDefined in: index.ts:137
Inherited from
cwd
cwd: stringDefined in: index.ts:139
Inherited from
signal
signal: null | SignalsDefined in: index.ts:141
Inherited from
status
status: null | numberDefined in: index.ts:140
Inherited from
stderr
stderr: string | Buffer<ArrayBufferLike>Defined in: index.ts:166
Overrides
stdout
stdout: null | string | Buffer<ArrayBufferLike>Defined in: index.ts:142
Inherited from
SpawnResultStderrBuffer
Defined in: index.ts:171
Extends
Properties
args
args: string[];Defined in: index.ts:138
Inherited from
command
command: stringDefined in: index.ts:137
Inherited from
cwd
cwd: stringDefined in: index.ts:139
Inherited from
signal
signal: null | SignalsDefined in: index.ts:141
Inherited from
status
status: null | numberDefined in: index.ts:140
Inherited from
stderr
stderr: BufferDefined in: index.ts:172
Overrides
stdout
stdout: null | Buffer<ArrayBufferLike>Defined in: index.ts:150
Inherited from
SpawnResultStderrString
Defined in: index.ts:168
Extends
Properties
args
args: string[];Defined in: index.ts:138
Inherited from
command
command: stringDefined in: index.ts:137
Inherited from
cwd
cwd: stringDefined in: index.ts:139
Inherited from
signal
signal: null | SignalsDefined in: index.ts:141
Inherited from
status
status: null | numberDefined in: index.ts:140
Inherited from
stderr
stderr: stringDefined in: index.ts:169
Overrides
stdout
stdout: null | stringDefined in: index.ts:146
Inherited from
SpawnResultStdioBuffers
Defined in: index.ts:185
Extends
Properties
args
args: string[];Defined in: index.ts:138
Inherited from
command
command: stringDefined in: index.ts:137
Inherited from
cwd
cwd: stringDefined in: index.ts:139
Inherited from
signal
signal: null | SignalsDefined in: index.ts:141
Inherited from
status
status: null | numberDefined in: index.ts:140
Inherited from
stderr
stderr: BufferDefined in: index.ts:187
Overrides
stdout
stdout: BufferDefined in: index.ts:186
Overrides
SpawnResultStdioStrings
Defined in: index.ts:181
Extends
Properties
args
args: string[];Defined in: index.ts:138
Inherited from
command
command: stringDefined in: index.ts:137
Inherited from
cwd
cwd: stringDefined in: index.ts:139
Inherited from
signal
signal: null | SignalsDefined in: index.ts:141
Inherited from
status
status: null | numberDefined in: index.ts:140
Inherited from
stderr
stderr: stringDefined in: index.ts:183
Overrides
stdout
stdout: stringDefined in: index.ts:182
Overrides
SpawnResultStdout
Defined in: index.ts:153
Extends
Properties
args
args: string[];Defined in: index.ts:138
Inherited from
command
command: stringDefined in: index.ts:137
Inherited from
cwd
cwd: stringDefined in: index.ts:139
Inherited from
signal
signal: null | SignalsDefined in: index.ts:141
Inherited from
status
status: null | numberDefined in: index.ts:140
Inherited from
stderr
stderr: null | string | Buffer<ArrayBufferLike>Defined in: index.ts:143
Inherited from
stdout
stdout: string | Buffer<ArrayBufferLike>Defined in: index.ts:154
Overrides
SpawnResultStdoutBuffer
Defined in: index.ts:159
Extends
Properties
args
args: string[];Defined in: index.ts:138
Inherited from
command
command: stringDefined in: index.ts:137
Inherited from
cwd
cwd: stringDefined in: index.ts:139
Inherited from
signal
signal: null | SignalsDefined in: index.ts:141
Inherited from
status
status: null | numberDefined in: index.ts:140
Inherited from
stderr
stderr: null | Buffer<ArrayBufferLike>Defined in: index.ts:151
Inherited from
stdout
stdout: BufferDefined in: index.ts:160
Overrides
SpawnResultStdoutString
Defined in: index.ts:156
Extends
Properties
args
args: string[];Defined in: index.ts:138
Inherited from
command
command: stringDefined in: index.ts:137
Inherited from
cwd
cwd: stringDefined in: index.ts:139
Inherited from
signal
signal: null | SignalsDefined in: index.ts:141
Inherited from
status
status: null | numberDefined in: index.ts:140
Inherited from
stderr
stderr: null | stringDefined in: index.ts:147
Inherited from
stdout
stdout: stringDefined in: index.ts:157
Overrides
SpawnResultString
Defined in: index.ts:145
Extends
Extended by
Properties
args
args: string[];Defined in: index.ts:138
Inherited from
command
command: stringDefined in: index.ts:137
Inherited from
cwd
cwd: stringDefined in: index.ts:139
Inherited from
signal
signal: null | SignalsDefined in: index.ts:141
Inherited from
status
status: null | numberDefined in: index.ts:140
Inherited from
stderr
stderr: null | stringDefined in: index.ts:147
Overrides
stdout
stdout: null | stringDefined in: index.ts:146
Overrides
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:211
Type Parameters
• T extends PromiseSpawnOptions
IOTypeNoPipe
type IOTypeNoPipe = Exclude<IOType, IOTypePipe>Defined in: index.ts:21
IOTypePipe
type IOTypePipe = 'overlapped' | 'pipe' | null | undefinedDefined in: index.ts:22
Override<T, R>
type Override<T, R> = Omit<T, keyof R> & RDefined in: index.ts:190
Type Parameters
• 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:192
Type Parameters
• T extends PromiseSpawnOptions
Functions
promiseSpawn()
function promiseSpawn<O, E>( command, args, opts, extra,): SpawnPromise<O, E>Defined in: index.ts:328
Spawn the specified command, and return a promise that resolves when the process closes or has an error.
Type Parameters
• O extends PromiseSpawnOptions =
PromiseSpawnOptionsStderrString
&
PromiseSpawnOptionsStdoutString
• E extends object = object
Parameters
command
string
args
string[]
opts
O = ...
extra
E = ...
Returns
SpawnPromise<O, E>