Skip to content
Myr

Improve documentation of `stdin`, `stdout`, `stderr` and `stdio` (#626)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by ehmicky · committed by GitHub · parent 3bbd8ae · Browse files · 2 files+165 added−84 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+165 added−84 removed

  • other:+165 added−84 removed

2 files+165 added−84 removed

modified:index.d.ts+79 added-38 removed
48 unmodified lines
4950export type CommonOptions<EncodingType extends EncodingOption = DefaultEncodingOption> = {51 /**52 Kill the spawned process when the parent process exits unless either:53 - the spawned process is [`detached`](https://nodejs.org/api/child_process.html#child_process_options_detached)54 - the parent process is terminated abruptly, for example, with `SIGKILL` as opposed to `SIGTERM` or a normal exit53 - the spawned process is [`detached`](https://nodejs.org/api/child_process.html#child_process_options_detached)54 - the parent process is terminated abruptly, for example, with `SIGKILL` as opposed to `SIGTERM` or a normal exit5556 @default true57 */58 readonly cleanup?: boolean;
36 unmodified lines
95 */96 readonly buffer?: boolean;9798 /**99 Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio).99 [How to setup](https://nodejs.org/api/child_process.html#child_process_options_stdio) the child process' standard input. This can be:100 - `'pipe'`: Sets [`childProcess.stdin`](https://nodejs.org/api/child_process.html#subprocessstdin) stream.101 - `'overlapped'`: Like `'pipe'` but asynchronous on Windows.102 - `'ignore'`: Do not use `stdin`.103 - `'ipc'`: Sets an [IPC channel](https://nodejs.org/api/child_process.html#subprocesssendmessage-sendhandle-options-callback). You can also use `execaNode()` instead.104 - `'inherit'`: Re-use the current process' `stdin`.105 - an integer: Re-use a specific file descriptor from the current process.106 - a Node.js `Readable` stream. It must have an underlying file or socket, such as the streams created by the `fs`, `net` or `http` core modules.107101 It can also be a file path, a file URL, a web stream ([`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream)), an [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) or an [`AsyncIterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols), unless either [`execaSync()`](#execasyncfile-arguments-options), the [`input` option](#input) or the [`inputFile` option](#inputfile) is used. If the file path is relative, it must start with `.`.108 Unless either the synchronous methods, the `input` option or the `inputFile` option is used, the value can also be a:109 - file path. If relative, it must start with `.`.110 - file URL.111 - web [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream).112 - [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) or [`AsyncIterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols)113114 @default `inherit` with `$`, `pipe` otherwise115 */116 readonly stdin?: StdinOption;117118 /**108 Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio).119 [How to setup](https://nodejs.org/api/child_process.html#child_process_options_stdio) the child process' standard output. This can be:120 - `'pipe'`: Sets [`childProcess.stdout`](https://nodejs.org/api/child_process.html#subprocessstdout) stream.121 - `'overlapped'`: Like `'pipe'` but asynchronous on Windows.122 - `'ignore'`: Do not use `stdout`.123 - `'ipc'`: Sets an [IPC channel](https://nodejs.org/api/child_process.html#subprocesssendmessage-sendhandle-options-callback). You can also use `execaNode()` instead.124 - `'inherit'`: Re-use the current process' `stdout`.125 - an integer: Re-use a specific file descriptor from the current process.126 - a Node.js `Writable` stream. It must have an underlying file or socket, such as the streams created by the `fs`, `net` or `http` core modules.127110 It can also be a file path, a file URL, a web stream ([`WritableStream`](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream)), unless [`execaSync()`](#execasyncfile-arguments-options) is used. If the file path is relative, it must start with `.`.128 Unless either synchronous methods, the value can also be a:129 - file path. If relative, it must start with `.`.130 - file URL.131 - web [`WritableStream`](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream).132133 @default 'pipe'134 */135 readonly stdout?: StdoutStderrOption;136137 /**117 Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio).138 [How to setup](https://nodejs.org/api/child_process.html#child_process_options_stdio) the child process' standard error. This can be:139 - `'pipe'`: Sets [`childProcess.stderr`](https://nodejs.org/api/child_process.html#subprocessstderr) stream.140 - `'overlapped'`: Like `'pipe'` but asynchronous on Windows.141 - `'ignore'`: Do not use `stderr`.142 - `'ipc'`: Sets an [IPC channel](https://nodejs.org/api/child_process.html#subprocesssendmessage-sendhandle-options-callback). You can also use `execaNode()` instead.143 - `'inherit'`: Re-use the current process' `stderr`.144 - an integer: Re-use a specific file descriptor from the current process.145 - a Node.js `Writable` stream. It must have an underlying file or socket, such as the streams created by the `fs`, `net` or `http` core modules.146119 It can also be a file path, a file URL, a web stream ([`WritableStream`](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream)), unless [`execaSync()`](#execasyncfile-arguments-options) is used. If the file path is relative, it must start with `.`.147 Unless either synchronous methods, the value can also be a:148 - file path. If relative, it must start with `.`.149 - file URL.150 - web [`WritableStream`](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream).151152 @default 'pipe'153 */154 readonly stderr?: StdoutStderrOption;
45 unmodified lines
200 */201 readonly argv0?: string;202203 /**173 Child's [stdio](https://nodejs.org/api/child_process.html#child_process_options_stdio) configuration.204 Like the `stdin`, `stdout` and `stderr` options but for all file descriptors at once.205 The possible values are the same except it can also be:206 - a single string, to set the same value to each standard stream.207 - an array with more than 3 values, to create more than 3 file descriptors.208209 @default 'pipe'210 */211 readonly stdio?: 'pipe' | 'overlapped' | 'ignore' | 'inherit' | readonly StdioOption[];212213 /**214 Specify the kind of serialization used for sending messages between processes when using the `stdio: 'ipc'` option or `execaNode()`:181 - `json`: Uses `JSON.stringify()` and `JSON.parse()`.182 - `advanced`: Uses [`v8.serialize()`](https://nodejs.org/api/v8.html#v8_v8_serialize_value)215 - `json`: Uses `JSON.stringify()` and `JSON.parse()`.216 - `advanced`: Uses [`v8.serialize()`](https://nodejs.org/api/v8.html#v8_v8_serialize_value)217218 [More info.](https://nodejs.org/api/child_process.html#child_process_advanced_serialization)219220 @default 'json'
108 unmodified lines
329};330331export type Options<EncodingType extends EncodingOption = DefaultEncodingOption> = {332 /**299 Write some input to the `stdin` of your binary.333 Write some input to the child process' `stdin`.\334 Streams are not allowed when using the synchronous methods.335301 If the input is a file, use the `inputFile` option instead.336 See also the `inputFile` and `stdin` options.337 */338 readonly input?: string | Uint8Array | Readable;339340 /**306 Use a file as input to the the `stdin` of your binary.341 Use a file as input to the child process' `stdin`.342308 If the input is not a file, use the `input` option instead.343 See also the `input` and `stdin` options.344 */345 readonly inputFile?: string | URL;346} & CommonOptions<EncodingType>;347
52 unmodified lines
400 */401 exitCode: number;402403 /**369 The output of the process on stdout.404 The output of the process on `stdout`.405406 This is `undefined` if the `stdout` option is set to [`'inherit'`, `'ipc'`, `'ignore'`, `Stream` or `integer`](https://nodejs.org/api/child_process.html#child_process_options_stdio).407 */408 stdout: StdoutStderrType;409410 /**374 The output of the process on stderr.411 The output of the process on `stderr`.412413 This is `undefined` if the `stderr` option is set to [`'inherit'`, `'ipc'`, `'ignore'`, `Stream` or `integer`](https://nodejs.org/api/child_process.html#child_process_options_stdio).414 */415 stderr: StdoutStderrType;416417 /**
7 unmodified lines
425 timedOut: boolean;426427 /**428 Whether the process was terminated using either:390 - `childProcess.kill()`.391 - A signal sent by another process. This case is [not supported on Windows](https://nodejs.org/api/process.html#signal-events).429 - `childProcess.kill()`.430 - A signal sent by another process. This case is [not supported on Windows](https://nodejs.org/api/process.html#signal-events).431 */432 isTerminated: boolean;433434 /**435 The name of the signal (like `SIGFPE`) that terminated the process using either:397 - `childProcess.kill()`.398 - A signal sent by another process. This case is [not supported on Windows](https://nodejs.org/api/process.html#signal-events).436 - `childProcess.kill()`.437 - A signal sent by another process. This case is [not supported on Windows](https://nodejs.org/api/process.html#signal-events).438439 If a signal terminated the process, this property is defined and included in the error message. Otherwise it is `undefined`.440 */441 signal?: string;
29 unmodified lines
471 The output of the process with `stdout` and `stderr` interleaved.472473 This is `undefined` if either:474 - the `all` option is `false` (default value)436 - `execaSync()` was used475 - the synchronous methods are used476 - both `stdout` and `stderr` options are set to [`'inherit'`, `'ipc'`, `'ignore'`, `Stream` or `integer`](https://nodejs.org/api/child_process.html#child_process_options_stdio)477 */478 all?: StdoutStderrType;479480 /**
7 unmodified lines
488export type ExecaSyncError<StdoutStderrType extends StdoutStderrAll = string> = {489 /**490 Error message when the child process failed to run. In addition to the underlying error message, it also contains some information related to why the child process errored.491452 The child process stderr then stdout are appended to the end, separated with newlines and not interleaved.492 The child process `stderr` then `stdout` are appended to the end, separated with newlines and not interleaved.493 */494 message: string;495496 /**457 This is the same as the `message` property except it does not include the child process stdout/stderr.497 This is the same as the `message` property except it does not include the child process `stdout`/`stderr`.498 */499 shortMessage: string;500501 /**462 Original error message. This is the same as the `message` property except it includes neither the child process stdout/stderr nor some additional information added by Execa.502 Original error message. This is the same as the `message` property excluding the child process `stdout`/`stderr` and some additional information added by Execa.503504 This is `undefined` unless the child process exited due to an `error` event or a timeout.505 */506 originalMessage?: string;
30 unmodified lines
537 /**538 Stream combining/interleaving [`stdout`](https://nodejs.org/api/child_process.html#child_process_subprocess_stdout) and [`stderr`](https://nodejs.org/api/child_process.html#child_process_subprocess_stderr).539540 This is `undefined` if either:501 - the `all` option is `false` (the default value)502 - both `stdout` and `stderr` options are set to [`'inherit'`, `'ipc'`, `Stream` or `integer`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio)541 - the `all` option is `false` (the default value)542 - the synchronous methods are used543 - both `stdout` and `stderr` options are set to [`'inherit'`, `'ipc'`, `'ignore'`, `Stream` or `integer`](https://nodejs.org/api/child_process.html#child_process_options_stdio)544 */545 all?: Readable;546547 catch<ResultType = never>(
53 unmodified lines
601602@param file - The program/script to execute, as a string or file URL603@param arguments - Arguments to pass to `file` on execution.604@returns An `ExecaChildProcess` that is both:564 - a `Promise` resolving or rejecting with a `childProcessResult`.565 - a [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess) with some additional methods and properties.605- a `Promise` resolving or rejecting with a `childProcessResult`.606- a [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess) with some additional methods and properties.607@throws A `childProcessResult` error608609@example <caption>Promise interface</caption>610```
180 unmodified lines
791This is the preferred method when executing a user-supplied `command` string, such as in a REPL.792793@param command - The program/script to execute and its arguments.794@returns An `ExecaChildProcess` that is both:754 - a `Promise` resolving or rejecting with a `childProcessResult`.755 - a [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess) with some additional methods and properties.795- a `Promise` resolving or rejecting with a `childProcessResult`.796- a [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess) with some additional methods and properties.797@throws A `childProcessResult` error798799@example800```
39 unmodified lines
840 /**841 Returns a new instance of `$` but with different default `options`. Consecutive calls are merged to previous ones.842843 This can be used to either:803 - Set options for a specific command: `` $(options)`command` ``804 - Share options for multiple commands: `` const $$ = $(options); $$`command`; $$`otherCommand` ``844 - Set options for a specific command: `` $(options)`command` ``845 - Share options for multiple commands: `` const $$ = $(options); $$`command`; $$`otherCommand` ``846847 @param options - Options to set848 @returns A new instance of `$` with those `options` set849
181 unmodified lines
10311032This is the preferred method when executing Node.js files.10331034Like [`child_process#fork()`](https://nodejs.org/api/child_process.html#child_process_child_process_fork_modulepath_args_options):994 - the current Node version and options are used. This can be overridden using the `nodePath` and `nodeOptions` options.995 - the `shell` option cannot be used996 - an extra channel [`ipc`](https://nodejs.org/api/child_process.html#child_process_options_stdio) is passed to `stdio`1035- the current Node version and options are used. This can be overridden using the `nodePath` and `nodeOptions` options.1036- the `shell` option cannot be used1037- an extra channel [`ipc`](https://nodejs.org/api/child_process.html#child_process_options_stdio) is passed to `stdio`10381039@param scriptPath - Node.js script to execute, as a string or file URL1040@param arguments - Arguments to pass to `scriptPath` on execution.1041@returns An `ExecaChildProcess` that is both:1001 - a `Promise` resolving or rejecting with a `childProcessResult`.1002 - a [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess) with some additional methods and properties.1042- a `Promise` resolving or rejecting with a `childProcessResult`.1043- a [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess) with some additional methods and properties.1044@throws A `childProcessResult` error10451046@example1047```
14 unmodified lines
modified:readme.md+86 added-46 removed
251 unmodified lines
252253This is the preferred method when executing Node.js files.254255Like [`child_process#fork()`](https://nodejs.org/api/child_process.html#child_process_child_process_fork_modulepath_args_options):256 - the current Node version and options are used. This can be overridden using the [`nodePath`](#nodepath-for-node-only) and [`nodeOptions`](#nodeoptions-for-node-only) options.257 - the [`shell`](#shell) option cannot be used258 - an extra channel [`ipc`](https://nodejs.org/api/child_process.html#child_process_options_stdio) is passed to [`stdio`](#stdio)256- the current Node version and options are used. This can be overridden using the [`nodePath`](#nodepath-for-node-only) and [`nodeOptions`](#nodeoptions-for-node-only) options.257- the [`shell`](#shell) option cannot be used258- an extra channel [`ipc`](https://nodejs.org/api/child_process.html#child_process_options_stdio) is passed to [`stdio`](#stdio)259260#### $\`command\`261262Executes a command. The `command` string includes both the `file` and its `arguments`. Returns a [`childProcess`](#childprocess).
10 unmodified lines
273274Returns a new instance of [`$`](#command) but with different default `options`. Consecutive calls are merged to previous ones.275276This can be used to either:277 - Set options for a specific command: `` $(options)`command` ``278 - Share options for multiple commands: `` const $$ = $(options); $$`command`; $$`otherCommand`; ``277- Set options for a specific command: `` $(options)`command` ``278- Share options for multiple commands: `` const $$ = $(options); $$`command`; $$`otherCommand`; ``279280#### execaCommand(command, options?)281282Executes a command. The `command` string includes both the `file` and its `arguments`. Returns a [`childProcess`](#childprocess).
27 unmodified lines
310311### childProcess312313The return value of all [asynchronous methods](#methods) is both:314 - a `Promise` resolving or rejecting with a [`childProcessResult`](#childProcessResult).315 - a [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess) with the following additional methods and properties.314- a `Promise` resolving or rejecting with a [`childProcessResult`](#childProcessResult).315- a [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess) with the following additional methods and properties.316317#### kill(signal?, options?)318319Same as the original [`child_process#kill()`](https://nodejs.org/api/child_process.html#child_process_subprocess_kill_signal) except: if `signal` is `SIGTERM` (the default value) and the child process is not terminated after 5 seconds, force it by sending `SIGKILL`.
15 unmodified lines
335336Stream combining/interleaving [`stdout`](https://nodejs.org/api/child_process.html#child_process_subprocess_stdout) and [`stderr`](https://nodejs.org/api/child_process.html#child_process_subprocess_stderr).337338This is `undefined` if either:339 - the [`all` option](#all-2) is `false` (the default value)340 - both [`stdout`](#stdout-1) and [`stderr`](#stderr-1) options are set to [`'inherit'`, `'ipc'`, `Stream` or `integer`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio)339- the [`all` option](#all-2) is `false` (the default value)340- the [synchronous methods](#execasyncfile-arguments-options) are used341- both [`stdout`](#stdout-1) and [`stderr`](#stderr-1) options are set to [`'inherit'`, `'ipc'`, `'ignore'`, `Stream` or `integer`](https://nodejs.org/api/child_process.html#child_process_options_stdio)342343#### pipeStdout(target)344345[Pipe](https://nodejs.org/api/stream.html#readablepipedestination-options) the child process's `stdout` to `target`, which can be:345 - Another [`execa()` return value](#pipe-multiple-processes)346 - A [writable stream](#save-and-pipe-output-from-a-child-process)347 - A [file path string](#redirect-output-to-a-file)346- Another [`execa()` return value](#pipe-multiple-processes)347- A [writable stream](#save-and-pipe-output-from-a-child-process)348- A [file path string](#redirect-output-to-a-file)349350If the `target` is another [`execa()` return value](#execacommandcommand-options), it is returned. Otherwise, the original `execa()` return value is returned. This allows chaining `pipeStdout()` then `await`ing the [final result](#childprocessresult).351352The [`stdout` option](#stdout-1) must be kept as `pipe`, its default value.
47 unmodified lines
400The numeric exit code of the process that was run.401402#### stdout403403Type: `string | Uint8Array`404Type: `string | Uint8Array | undefined`405405The output of the process on stdout.406The output of the process on `stdout`.407408This is `undefined` if the [`stdout`](#stdout-1) option is set to [`'inherit'`, `'ipc'`, `'ignore'`, `Stream` or `integer`](https://nodejs.org/api/child_process.html#child_process_options_stdio).409410#### stderr411409Type: `string | Uint8Array`412Type: `string | Uint8Array | undefined`413411The output of the process on stderr.414The output of the process on `stderr`.415416This is `undefined` if the [`stderr`](#stderr-1) option is set to [`'inherit'`, `'ipc'`, `'ignore'`, `Stream` or `integer`](https://nodejs.org/api/child_process.html#child_process_options_stdio).417418#### all419420Type: `string | Uint8Array | undefined`421422The output of the process with `stdout` and `stderr` interleaved.423424This is `undefined` if either:420 - the [`all` option](#all-2) is `false` (the default value)421 - `execaSync()` was used425- the [`all` option](#all-2) is `false` (the default value)426- the [synchronous methods](#execasyncfile-arguments-options) are used427- both [`stdout`](#stdout-1) and [`stderr`](#stderr-1) options are set to [`'inherit'`, `'ipc'`, `'ignore'`, `Stream` or `integer`](https://nodejs.org/api/child_process.html#child_process_options_stdio)428429#### failed430431Type: `boolean`
18 unmodified lines
450451Type: `boolean`452453Whether the process was terminated using either:448 - [`childProcess.kill()`](#killsignal-options).449 - A signal sent by another process. This case is [not supported on Windows](https://nodejs.org/api/process.html#signal-events).454- [`childProcess.kill()`](#killsignal-options).455- A signal sent by another process. This case is [not supported on Windows](https://nodejs.org/api/process.html#signal-events).456457#### signal458459Type: `string | undefined`460461The name of the signal (like `SIGFPE`) that terminated the process using either:456 - [`childProcess.kill()`](#killsignal-options).457 - A signal sent by another process. This case is [not supported on Windows](https://nodejs.org/api/process.html#signal-events).462- [`childProcess.kill()`](#killsignal-options).463- A signal sent by another process. This case is [not supported on Windows](https://nodejs.org/api/process.html#signal-events).464465If a signal terminated the process, this property is defined and included in the error message. Otherwise it is `undefined`.466467#### signalDescription
15 unmodified lines
483Type: `string`484485Error message when the child process failed to run. In addition to the [underlying error message](#originalMessage), it also contains some information related to why the child process errored.486481The child process [stderr](#stderr) then [stdout](#stdout) are appended to the end, separated with newlines and not interleaved.487The child process [`stderr`](#stderr) then [`stdout`](#stdout) are appended to the end, separated with newlines and not interleaved.488489#### shortMessage490491Type: `string`492487This is the same as the [`message` property](#message) except it does not include the child process stdout/stderr.493This is the same as the [`message` property](#message) except it does not include the child process `stdout`/`stderr`.494495#### originalMessage496497Type: `string | undefined`498493Original error message. This is the same as the `message` property except it includes neither the child process stdout/stderr nor some additional information added by Execa.499Original error message. This is the same as the `message` property excluding the child process `stdout`/`stderr` and some additional information added by Execa.500501This is `undefined` unless the child process exited due to an `error` event or a timeout.502503### options
49 unmodified lines
553#### input554555Type: `string | Uint8Array | stream.Readable`556551Write some input to the `stdin` of your binary.\552Streams are not allowed when using the synchronous methods.557Write some input to the child process' `stdin`.\558Streams are not allowed when using the [synchronous methods](#execasyncfile-arguments-options).559554If the input is a file, use the [`inputFile` option](#inputfile) instead.560See also the [`inputFile`](#inputfile) and [`stdin`](#stdin) options.561562#### inputFile563564Type: `string | URL`565560Use a file as input to the the `stdin` of your binary.566Use a file as input to the child process' `stdin`.567562If the input is not a file, use the [`input` option](#input) instead.568See also the [`input`](#input) and [`stdin`](#stdin) options.569570#### stdin571566Type: `string | number | stream.Readable | ReadableStream | undefined | URL | Iterable<string | Uint8Array> | AsyncIterable<string | Uint8Array>`\572Type: `string | number | stream.Readable | ReadableStream | URL | Iterable<string | Uint8Array> | AsyncIterable<string | Uint8Array>`\573Default: `inherit` with [`$`](#command), `pipe` otherwise574569Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio).575[How to setup](https://nodejs.org/api/child_process.html#child_process_options_stdio) the child process' standard input. This can be:576- `'pipe'`: Sets [`childProcess.stdin`](https://nodejs.org/api/child_process.html#subprocessstdin) stream.577- `'overlapped'`: Like `'pipe'` but asynchronous on Windows.578- `'ignore'`: Do not use `stdin`.579- `'ipc'`: Sets an [IPC channel](https://nodejs.org/api/child_process.html#subprocesssendmessage-sendhandle-options-callback). You can also use [`execaNode()`](#execanodescriptpath-arguments-options) instead.580- `'inherit'`: Re-use the current process' `stdin`.581- an integer: Re-use a specific file descriptor from the current process.582- a Node.js `Readable` stream. It must have an underlying file or socket, such as the streams created by the `fs`, `net` or `http` core modules.583571It can also be a file path, a file URL, a web stream ([`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream)), an [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) or an [`AsyncIterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols), unless either [`execaSync()`](#execasyncfile-arguments-options), the [`input` option](#input) or the [`inputFile` option](#inputfile) is used. If the file path is relative, it must start with `.`.584Unless either the [synchronous methods](#execasyncfile-arguments-options), the [`input` option](#input) or the [`inputFile` option](#inputfile) is used, the value can also be a:585- file path. If relative, it must start with `.`.586- file URL.587- web [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream).588- [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) or [`AsyncIterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols)589590#### stdout591575Type: `string | number | stream.Writable | WritableStream | undefined | URL`\592Type: `string | number | stream.Writable | WritableStream | URL`\593Default: `pipe`594578Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio).595[How to setup](https://nodejs.org/api/child_process.html#child_process_options_stdio) the child process' standard output. This can be:596- `'pipe'`: Sets [`childProcess.stdout`](https://nodejs.org/api/child_process.html#subprocessstdout) stream.597- `'overlapped'`: Like `'pipe'` but asynchronous on Windows.598- `'ignore'`: Do not use `stdout`.599- `'ipc'`: Sets an [IPC channel](https://nodejs.org/api/child_process.html#subprocesssendmessage-sendhandle-options-callback). You can also use [`execaNode()`](#execanodescriptpath-arguments-options) instead.600- `'inherit'`: Re-use the current process' `stdout`.601- an integer: Re-use a specific file descriptor from the current process.602- a Node.js `Writable` stream. It must have an underlying file or socket, such as the streams created by the `fs`, `net` or `http` core modules.603580It can also be a file path, a file URL, a web stream ([`WritableStream`](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream)), unless [`execaSync()`](#execasyncfile-arguments-options) is used. If the file path is relative, it must start with `.`.604Unless either [synchronous methods](#execasyncfile-arguments-options), the value can also be a:605- file path. If relative, it must start with `.`.606- file URL.607- web [`WritableStream`](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream).608609#### stderr610584Type: `string | number | stream.Writable | WritableStream | undefined | URL`\611Type: `string | number | stream.Writable | WritableStream | URL`\612Default: `pipe`613587Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio).614[How to setup](https://nodejs.org/api/child_process.html#child_process_options_stdio) the child process' standard error. This can be:615- `'pipe'`: Sets [`childProcess.stderr`](https://nodejs.org/api/child_process.html#subprocessstderr) stream.616- `'overlapped'`: Like `'pipe'` but asynchronous on Windows.617- `'ignore'`: Do not use `stderr`.618- `'ipc'`: Sets an [IPC channel](https://nodejs.org/api/child_process.html#subprocesssendmessage-sendhandle-options-callback). You can also use [`execaNode()`](#execanodescriptpath-arguments-options) instead.619- `'inherit'`: Re-use the current process' `stderr`.620- an integer: Re-use a specific file descriptor from the current process.621- a Node.js `Writable` stream. It must have an underlying file or socket, such as the streams created by the `fs`, `net` or `http` core modules.622589It can also be a file path, a file URL, a web stream ([`WritableStream`](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream)), unless [`execaSync()`](#execasyncfile-arguments-options) is used. If the file path is relative, it must start with `.`.623Unless either [synchronous methods](#execasyncfile-arguments-options), the value can also be a:624- file path. If relative, it must start with `.`.625- file URL.626- web [`WritableStream`](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream).627628#### stdio629630Type: `string | [StdinOption, StdoutOption, StderrOption] | StdioOption[]`\631Default: `pipe`632633Like the [`stdin`](#stdin), [`stdout`](#stdout-1) and [`stderr`](#stderr-1) options but for all file descriptors at once.\634The possible values are the same except it can also be:635- a single string, to set the same value to each standard stream.636- an array with more than 3 values, to create more than 3 file descriptors.637638#### all639640Type: `boolean`\641Default: `false`
44 unmodified lines
686Type: `string`687688Explicitly set the value of `argv[0]` sent to the child process. This will be set to `file` if not specified.689643#### stdio644645Type: `string | string[]`\646Default: `pipe`647648Child's [stdio](https://nodejs.org/api/child_process.html#child_process_options_stdio) configuration.649690#### serialization691692Type: `string`\693Default: `'json'`
168 unmodified lines