vlt / docs

  • PricingBenchmarks (opens in new window)Community (opens in new window)Feedback
  • Overview
    • Overview
    • Reference
  • Classes
  • SpawnPromise<O, T>
  • Interfaces
  • PromiseSpawnOptions
  • PromiseSpawnOptionsBuffer
  • PromiseSpawnOptionsNoStderr
  • PromiseSpawnOptionsNoStdin
  • PromiseSpawnOptionsNoStdout
  • PromiseSpawnOptionsStderr
  • PromiseSpawnOptionsStderrBuffer
  • PromiseSpawnOptionsStderrString
  • PromiseSpawnOptionsStdin
  • PromiseSpawnOptionsStdout
  • PromiseSpawnOptionsStdoutBuffer
  • PromiseSpawnOptionsStdoutString
  • PromiseSpawnOptionsString
  • SpawnResult
  • SpawnResultBuffer
  • SpawnResultNoStderr
  • SpawnResultNoStdio
  • SpawnResultNoStdout
  • SpawnResultStderr
  • SpawnResultStderrBuffer
  • SpawnResultStderrString
  • SpawnResultStdioBuffers
  • SpawnResultStdioStrings
  • SpawnResultStdout
  • SpawnResultStdoutBuffer
  • SpawnResultStdoutString
  • SpawnResultString
  • Type Aliases
  • ChildProcessByOptions<T>
  • IOTypeNoPipe
  • IOTypePipe
  • Override<T, R>
  • SpawnResultByOptions<T>
  • Functions
  • promiseSpawn()
  1. Client
  2. /
  3. API Reference
  4. /
  5. @vltpkg/promise-spawn
  6. /
  7. Reference

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 ParameterDefault type
O extends PromiseSpawnOptions-
T extends objectobject

Constructors

new SpawnPromise()
TypeScript
new SpawnPromise<O, T>(
   command, 
   args, 
   opts, 
extra): SpawnPromise<O, T>

Defined in: index.ts:236

Parameters
ParameterType
commandstring
argsstring[]
optsO
extraT
Returns

SpawnPromise<O, T>

Overrides
TypeScript
Promise<SpawnResultByOptions<O> & T>.constructor

Properties

PropertyTypeDefault valueDescriptionOverrides
[toStringTag]string'SpawnPromise'-Promise.[toStringTag]
processChildProcessByOptions<O>undefinedThe spawned process this promise references-
stdinO extends PromiseSpawnOptionsNoStdin ? null : WritableundefinedExpose the child process stdin, if available-

Accessors

[species]
Get Signature
TypeScript
get static species: PromiseConstructor

Defined 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
TypeScript
Promise.[species]

Interfaces

PromiseSpawnOptions

Defined in: index.ts:23

Extends

  • SpawnOptions

Extended by

  • PromiseSpawnOptionsString
  • PromiseSpawnOptionsBuffer
  • PromiseSpawnOptionsStdin
  • PromiseSpawnOptionsNoStdin
  • PromiseSpawnOptionsStdout
  • PromiseSpawnOptionsNoStdout
  • PromiseSpawnOptionsStderr
  • PromiseSpawnOptionsNoStderr

Properties

PropertyType
acceptFail?boolean
stdioString?boolean

PromiseSpawnOptionsBuffer

Defined in: index.ts:30

Extends

  • PromiseSpawnOptions

Properties

PropertyTypeOverridesInherited from
acceptFail?boolean-PromiseSpawnOptions.acceptFail
stdioStringfalsePromiseSpawnOptions.stdioString-

PromiseSpawnOptionsNoStderr

Defined in: index.ts:92

Extends

  • PromiseSpawnOptions

Properties

PropertyTypeDescriptionOverridesInherited 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

  • PromiseSpawnOptions

Properties

PropertyTypeDescriptionOverridesInherited 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

  • PromiseSpawnOptions

Properties

PropertyTypeDescriptionOverridesInherited 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

  • PromiseSpawnOptions

Extended by

  • PromiseSpawnOptionsStderrString
  • PromiseSpawnOptionsStderrBuffer

Properties

PropertyTypeDescriptionOverridesInherited 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

  • PromiseSpawnOptionsStderr

Properties

PropertyTypeDescriptionOverridesInherited 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
stdioStringfalse-PromiseSpawnOptionsStderr.stdioString-

PromiseSpawnOptionsStderrString

Defined in: index.ts:86

Extends

  • PromiseSpawnOptionsStderr

Properties

PropertyTypeDescriptionOverridesInherited 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

  • PromiseSpawnOptions

Properties

PropertyTypeDescriptionOverridesInherited 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

  • PromiseSpawnOptions

Extended by

  • PromiseSpawnOptionsStdoutString
  • PromiseSpawnOptionsStdoutBuffer

Properties

PropertyTypeDescriptionOverridesInherited 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

  • PromiseSpawnOptionsStdout

Properties

PropertyTypeDescriptionOverridesInherited 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
stdioStringfalse-PromiseSpawnOptionsStdout.stdioString-

PromiseSpawnOptionsStdoutString

Defined in: index.ts:61

Extends

  • PromiseSpawnOptionsStdout

Properties

PropertyTypeDescriptionOverridesInherited 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

  • PromiseSpawnOptions

Properties

PropertyTypeOverridesInherited from
acceptFail?boolean-PromiseSpawnOptions.acceptFail
stdioString?truePromiseSpawnOptions.stdioString-

SpawnResult

Defined in: index.ts:123

Extended by

  • SpawnResultString
  • SpawnResultBuffer
  • SpawnResultStdout
  • SpawnResultNoStdout
  • SpawnResultStderr
  • SpawnResultNoStderr
  • SpawnResultNoStdio
  • SpawnResultStdioStrings
  • SpawnResultStdioBuffers

Properties

PropertyType
argsstring[]
commandstring
cwdstring
signalnull | Signals
statusnull | number
stderrnull | string | Buffer<ArrayBufferLike>
stdoutnull | string | Buffer<ArrayBufferLike>

SpawnResultBuffer

Defined in: index.ts:136

Extends

  • SpawnResult

Extended by

  • SpawnResultStdoutBuffer
  • SpawnResultStderrBuffer

Properties

PropertyTypeOverridesInherited from
argsstring[]-SpawnResult.args
commandstring-SpawnResult.command
cwdstring-SpawnResult.cwd
signalnull | Signals-SpawnResult.signal
statusnull | number-SpawnResult.status
stderrnull | Buffer<ArrayBufferLike>SpawnResult.stderr-
stdoutnull | Buffer<ArrayBufferLike>SpawnResult.stdout-

SpawnResultNoStderr

Defined in: index.ts:161

Extends

  • SpawnResult

Properties

PropertyTypeOverridesInherited from
argsstring[]-SpawnResult.args
commandstring-SpawnResult.command
cwdstring-SpawnResult.cwd
signalnull | Signals-SpawnResult.signal
statusnull | number-SpawnResult.status
stderrnullSpawnResult.stderr-
stdoutnull | string | Buffer<ArrayBufferLike>-SpawnResult.stdout

SpawnResultNoStdio

Defined in: index.ts:164

Extends

  • SpawnResult

Properties

PropertyTypeOverridesInherited from
argsstring[]-SpawnResult.args
commandstring-SpawnResult.command
cwdstring-SpawnResult.cwd
signalnull | Signals-SpawnResult.signal
statusnull | number-SpawnResult.status
stderrnullSpawnResult.stderr-
stdoutnullSpawnResult.stdout-

SpawnResultNoStdout

Defined in: index.ts:149

Extends

  • SpawnResult

Properties

PropertyTypeOverridesInherited from
argsstring[]-SpawnResult.args
commandstring-SpawnResult.command
cwdstring-SpawnResult.cwd
signalnull | Signals-SpawnResult.signal
statusnull | number-SpawnResult.status
stderrnull | string | Buffer<ArrayBufferLike>-SpawnResult.stderr
stdoutnullSpawnResult.stdout-

SpawnResultStderr

Defined in: index.ts:152

Extends

  • SpawnResult

Properties

PropertyTypeOverridesInherited from
argsstring[]-SpawnResult.args
commandstring-SpawnResult.command
cwdstring-SpawnResult.cwd
signalnull | Signals-SpawnResult.signal
statusnull | number-SpawnResult.status
stderrstring | Buffer<ArrayBufferLike>SpawnResult.stderr-
stdoutnull | string | Buffer<ArrayBufferLike>-SpawnResult.stdout

SpawnResultStderrBuffer

Defined in: index.ts:158

Extends

  • SpawnResultBuffer

Properties

PropertyTypeOverridesInherited from
argsstring[]-SpawnResultBuffer.args
commandstring-SpawnResultBuffer.command
cwdstring-SpawnResultBuffer.cwd
signalnull | Signals-SpawnResultBuffer.signal
statusnull | number-SpawnResultBuffer.status
stderrBufferSpawnResultBuffer.stderr-
stdoutnull | Buffer<ArrayBufferLike>-SpawnResultBuffer.stdout

SpawnResultStderrString

Defined in: index.ts:155

Extends

  • SpawnResultString

Properties

PropertyTypeOverridesInherited from
argsstring[]-SpawnResultString.args
commandstring-SpawnResultString.command
cwdstring-SpawnResultString.cwd
signalnull | Signals-SpawnResultString.signal
statusnull | number-SpawnResultString.status
stderrstringSpawnResultString.stderr-
stdoutnull | string-SpawnResultString.stdout

SpawnResultStdioBuffers

Defined in: index.ts:172

Extends

  • SpawnResult

Properties

PropertyTypeOverridesInherited from
argsstring[]-SpawnResult.args
commandstring-SpawnResult.command
cwdstring-SpawnResult.cwd
signalnull | Signals-SpawnResult.signal
statusnull | number-SpawnResult.status
stderrBufferSpawnResult.stderr-
stdoutBufferSpawnResult.stdout-

SpawnResultStdioStrings

Defined in: index.ts:168

Extends

  • SpawnResult

Properties

PropertyTypeOverridesInherited from
argsstring[]-SpawnResult.args
commandstring-SpawnResult.command
cwdstring-SpawnResult.cwd
signalnull | Signals-SpawnResult.signal
statusnull | number-SpawnResult.status
stderrstringSpawnResult.stderr-
stdoutstringSpawnResult.stdout-

SpawnResultStdout

Defined in: index.ts:140

Extends

  • SpawnResult

Properties

PropertyTypeOverridesInherited from
argsstring[]-SpawnResult.args
commandstring-SpawnResult.command
cwdstring-SpawnResult.cwd
signalnull | Signals-SpawnResult.signal
statusnull | number-SpawnResult.status
stderrnull | string | Buffer<ArrayBufferLike>-SpawnResult.stderr
stdoutstring | Buffer<ArrayBufferLike>SpawnResult.stdout-

SpawnResultStdoutBuffer

Defined in: index.ts:146

Extends

  • SpawnResultBuffer

Properties

PropertyTypeOverridesInherited from
argsstring[]-SpawnResultBuffer.args
commandstring-SpawnResultBuffer.command
cwdstring-SpawnResultBuffer.cwd
signalnull | Signals-SpawnResultBuffer.signal
statusnull | number-SpawnResultBuffer.status
stderrnull | Buffer<ArrayBufferLike>-SpawnResultBuffer.stderr
stdoutBufferSpawnResultBuffer.stdout-

SpawnResultStdoutString

Defined in: index.ts:143

Extends

  • SpawnResultString

Properties

PropertyTypeOverridesInherited from
argsstring[]-SpawnResultString.args
commandstring-SpawnResultString.command
cwdstring-SpawnResultString.cwd
signalnull | Signals-SpawnResultString.signal
statusnull | number-SpawnResultString.status
stderrnull | string-SpawnResultString.stderr
stdoutstringSpawnResultString.stdout-

SpawnResultString

Defined in: index.ts:132

Extends

  • SpawnResult

Extended by

  • SpawnResultStdoutString
  • SpawnResultStderrString

Properties

PropertyTypeOverridesInherited from
argsstring[]-SpawnResult.args
commandstring-SpawnResult.command
cwdstring-SpawnResult.cwd
signalnull | Signals-SpawnResult.signal
statusnull | number-SpawnResult.status
stderrnull | stringSpawnResult.stderr-
stdoutnull | stringSpawnResult.stdout-

Type Aliases

ChildProcessByOptions<T>

TypeScript
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

TypeScript
type IOTypeNoPipe = Exclude<IOType, IOTypePipe>;

Defined in: index.ts:20


IOTypePipe

TypeScript
type IOTypePipe = "overlapped" | "pipe" | null | undefined;

Defined in: index.ts:21


Override<T, R>

TypeScript
type Override<T, R> = Omit<T, keyof R> & R;

Defined in: index.ts:177

Type Parameters

Type Parameter
T
R

SpawnResultByOptions<T>

TypeScript
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()

TypeScript
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 ParameterDefault type
O extends PromiseSpawnOptionsPromiseSpawnOptionsStderrString & PromiseSpawnOptionsStdoutString
E extends objectobject

Parameters

ParameterType
commandstring
argsstring[]
optsO
extraE

Returns

SpawnPromise<O, E>


Previous@vltpkg/promise-spawnNext@vltpkg/query

On this page

  • Classes
  • SpawnPromise<O, T>
  • Interfaces
  • PromiseSpawnOptions
  • PromiseSpawnOptionsBuffer
  • PromiseSpawnOptionsNoStderr
  • PromiseSpawnOptionsNoStdin
  • PromiseSpawnOptionsNoStdout
  • PromiseSpawnOptionsStderr
  • PromiseSpawnOptionsStderrBuffer
  • PromiseSpawnOptionsStderrString
  • PromiseSpawnOptionsStdin
  • PromiseSpawnOptionsStdout
  • PromiseSpawnOptionsStdoutBuffer
  • PromiseSpawnOptionsStdoutString
  • PromiseSpawnOptionsString
  • SpawnResult
  • SpawnResultBuffer
  • SpawnResultNoStderr
  • SpawnResultNoStdio
  • SpawnResultNoStdout
  • SpawnResultStderr
  • SpawnResultStderrBuffer
  • SpawnResultStderrString
  • SpawnResultStdioBuffers
  • SpawnResultStdioStrings
  • SpawnResultStdout
  • SpawnResultStdoutBuffer
  • SpawnResultStdoutString
  • SpawnResultString
  • Type Aliases
  • ChildProcessByOptions<T>
  • IOTypeNoPipe
  • IOTypePipe
  • Override<T, R>
  • SpawnResultByOptions<T>
  • Functions
  • promiseSpawn()

Deploy your package on vlt.io

Publish scoped and private packages, manage organizations and access, and give every developer and CI environment a consistent source for public and private JavaScript dependencies.

Publish now