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
Provenance
- Commit
c405105- Tree
84b20ab- Author
ehmicky <ehmicky@users.noreply.github.com>- Committer
GitHub <noreply@github.com>- Parent
3bbd8ae
2 files changed+165 added−84 removed
modified:index.d.ts+79 added-38 removed
48 unmodified lines49 50 export 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 exit55 56 @default true57 */58 readonly cleanup?: boolean;36 unmodified lines95 */96 readonly buffer?: boolean;97 98 /**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.107 101- 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)113 114 @default `inherit` with `$`, `pipe` otherwise115 */116 readonly stdin?: StdinOption;117 118 /**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.127 110- 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).132 133 @default 'pipe'134 */135 readonly stdout?: StdoutStderrOption;136 137 /**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.146 119- 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).151 152 @default 'pipe'153 */154 readonly stderr?: StdoutStderrOption;45 unmodified lines200 */201 readonly argv0?: string;202 203 /**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.208 209 @default 'pipe'210 */211 readonly stdio?: 'pipe' | 'overlapped' | 'ignore' | 'inherit' | readonly StdioOption[];212 213 /**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)217 218 [More info.](https://nodejs.org/api/child_process.html#child_process_advanced_serialization)219 220 @default 'json'108 unmodified lines329 };330 331 export 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.335 301- 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;339 340 /**306- Use a file as input to the the `stdin` of your binary.341+ Use a file as input to the child process' `stdin`.342 308- 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 lines400 */401 exitCode: number;402 403 /**369- The output of the process on stdout.404+ The output of the process on `stdout`.405+406+ 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;409 410 /**374- The output of the process on stderr.411+ The output of the process on `stderr`.412+413+ 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;416 417 /**7 unmodified lines425 timedOut: boolean;426 427 /**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;433 434 /**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).438 439 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 lines471 The output of the process with `stdout` and `stderr` interleaved.472 473 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;479 480 /**7 unmodified lines488 export 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.491 452- 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;495 496 /**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;500 501 /**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.503 504 This is `undefined` unless the child process exited due to an `error` event or a timeout.505 */506 originalMessage?: string;30 unmodified lines537 /**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).539 540 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;546 547 catch<ResultType = never>(53 unmodified lines601 602 @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` error608 609 @example <caption>Promise interface</caption>610 ```180 unmodified lines791 This is the preferred method when executing a user-supplied `command` string, such as in a REPL.792 793 @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` error798 799 @example800 ```39 unmodified lines840 /**841 Returns a new instance of `$` but with different default `options`. Consecutive calls are merged to previous ones.842 843 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` ``846 847 @param options - Options to set848 @returns A new instance of `$` with those `options` set849 181 unmodified lines1031 1032 This is the preferred method when executing Node.js files.1033 1034 Like [`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`1038 1039 @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` error1045 1046 @example1047 ```14 unmodified linesmodified:readme.md+86 added-46 removed
251 unmodified lines252 253 This is the preferred method when executing Node.js files.254 255 Like [`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)259 260 #### $\`command\`261 262 Executes a command. The `command` string includes both the `file` and its `arguments`. Returns a [`childProcess`](#childprocess).10 unmodified lines273 274 Returns a new instance of [`$`](#command) but with different default `options`. Consecutive calls are merged to previous ones.275 276 This 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`; ``279 280 #### execaCommand(command, options?)281 282 Executes a command. The `command` string includes both the `file` and its `arguments`. Returns a [`childProcess`](#childprocess).27 unmodified lines310 311 ### childProcess312 313 The 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.316 317 #### kill(signal?, options?)318 319 Same 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 lines335 336 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).337 338 This 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)342 343 #### pipeStdout(target)344 345 [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)349 350 If 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).351 352 The [`stdout` option](#stdout-1) must be kept as `pipe`, its default value.47 unmodified lines400 The numeric exit code of the process that was run.401 402 #### stdout403 403-Type: `string | Uint8Array`404+Type: `string | Uint8Array | undefined`405 405-The output of the process on stdout.406+The output of the process on `stdout`.407 408+This 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).409+410 #### stderr411 409-Type: `string | Uint8Array`412+Type: `string | Uint8Array | undefined`413 411-The output of the process on stderr.414+The output of the process on `stderr`.415 416+This 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).417+418 #### all419 420 Type: `string | Uint8Array | undefined`421 422 The output of the process with `stdout` and `stderr` interleaved.423 424 This 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)428 429 #### failed430 431 Type: `boolean`18 unmodified lines450 451 Type: `boolean`452 453 Whether 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).456 457 #### signal458 459 Type: `string | undefined`460 461 The 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).464 465 If a signal terminated the process, this property is defined and included in the error message. Otherwise it is `undefined`.466 467 #### signalDescription15 unmodified lines483 Type: `string`484 485 Error 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.486 481-The child process [stderr](#stderr) then [stdout](#stdout) are appended to the end, separated with newlines and not interleaved.487+The child process [`stderr`](#stderr) then [`stdout`](#stdout) are appended to the end, separated with newlines and not interleaved.488 489 #### shortMessage490 491 Type: `string`492 487-This is the same as the [`message` property](#message) except it does not include the child process stdout/stderr.493+This is the same as the [`message` property](#message) except it does not include the child process `stdout`/`stderr`.494 495 #### originalMessage496 497 Type: `string | undefined`498 493-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.499+Original error message. This is the same as the `message` property excluding the child process `stdout`/`stderr` and some additional information added by Execa.500 501 This is `undefined` unless the child process exited due to an `error` event or a timeout.502 503 ### options49 unmodified lines553 #### input554 555 Type: `string | Uint8Array | stream.Readable`556 551-Write some input to the `stdin` of your binary.\552-Streams are not allowed when using the synchronous methods.557+Write some input to the child process' `stdin`.\558+Streams are not allowed when using the [synchronous methods](#execasyncfile-arguments-options).559 554-If the input is a file, use the [`inputFile` option](#inputfile) instead.560+See also the [`inputFile`](#inputfile) and [`stdin`](#stdin) options.561 562 #### inputFile563 564 Type: `string | URL`565 560-Use a file as input to the the `stdin` of your binary.566+Use a file as input to the child process' `stdin`.567 562-If the input is not a file, use the [`input` option](#input) instead.568+See also the [`input`](#input) and [`stdin`](#stdin) options.569 570 #### stdin571 566-Type: `string | number | stream.Readable | ReadableStream | undefined | URL | Iterable<string | Uint8Array> | AsyncIterable<string | Uint8Array>`\572+Type: `string | number | stream.Readable | ReadableStream | URL | Iterable<string | Uint8Array> | AsyncIterable<string | Uint8Array>`\573 Default: `inherit` with [`$`](#command), `pipe` otherwise574 569-Same 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.583 571-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 `.`.584+Unless 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)589 590 #### stdout591 575-Type: `string | number | stream.Writable | WritableStream | undefined | URL`\592+Type: `string | number | stream.Writable | WritableStream | URL`\593 Default: `pipe`594 578-Same 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.603 580-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 `.`.604+Unless 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).608 609 #### stderr610 584-Type: `string | number | stream.Writable | WritableStream | undefined | URL`\611+Type: `string | number | stream.Writable | WritableStream | URL`\612 Default: `pipe`613 587-Same 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.622 589-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 `.`.623+Unless 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).627 628+#### stdio629+630+Type: `string | [StdinOption, StdoutOption, StderrOption] | StdioOption[]`\631+Default: `pipe`632+633+Like the [`stdin`](#stdin), [`stdout`](#stdout-1) and [`stderr`](#stderr-1) options but for all file descriptors at once.\634+The 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.637+638 #### all639 640 Type: `boolean`\641 Default: `false`44 unmodified lines686 Type: `string`687 688 Explicitly set the value of `argv[0]` sent to the child process. This will be set to `file` if not specified.689 643-#### stdio644-645-Type: `string | string[]`\646-Default: `pipe`647-648-Child's [stdio](https://nodejs.org/api/child_process.html#child_process_options_stdio) configuration.649-690 #### serialization691 692 Type: `string`\693 Default: `'json'`168 unmodified lines