Move the `childProcess` section in the readme.md (#539)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by ehmicky · committed by GitHub · parent 588cea8 · Browse files · 1 file·+52 added−52 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+52 added−52 removed
- other:+52 added−52 removed
Provenance
- Commit
4993dcb- Tree
8422123- Author
ehmicky <ehmicky@users.noreply.github.com>- Committer
GitHub <noreply@github.com>- Parent
588cea8
1 file changed+52 added−52 removed
modified:readme.md+52 added-52 removed
277 unmodified lines278 No escaping/quoting is needed.279 280 Unless the [`shell`](#shell) option is used, no shell interpreter (Bash, `cmd.exe`, etc.) is used, so shell features such as variables substitution (`echo $PATH`) are not allowed.281 282-### childProcess283-284-This is both:285- - a `Promise` resolving or rejecting with a [`childProcessResult`](#childProcessResult).286- - a [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess) with the following additional methods and properties.287-288-#### kill(signal?, options?)289-290-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`.291-292-##### options.forceKillAfterTimeout293-294-Type: `number | false`\295-Default: `5000`296-297-Milliseconds to wait for the child process to terminate before sending `SIGKILL`.298-299-Can be disabled with `false`.300-301-#### all302-303-Type: `ReadableStream | undefined`304-305-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).306-307-This is `undefined` if either:308- - the [`all` option](#all-2) is `false` (the default value)309- - 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)310-311-#### pipeStdout(target)312-313-[Pipe](https://nodejs.org/api/stream.html#readablepipedestination-options) the child process's `stdout` to `target`, which can be:314- - Another [`execa()` return value](#pipe-multiple-processes)315- - A [writable stream](#save-and-pipe-output-from-a-child-process)316- - A [file path string](#redirect-output-to-a-file)317-318-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).319-320-The [`stdout` option](#stdout-1) must be kept as `pipe`, its default value.321-322-#### pipeStderr(target)323-324-Like [`pipeStdout()`](#pipestdouttarget) but piping the child process's `stderr` instead.325-326-The [`stderr` option](#stderr-1) must be kept as `pipe`, its default value.327-328-#### pipeAll(target)329-330-Combines both [`pipeStdout()`](#pipestdouttarget) and [`pipeStderr()`](#pipestderrtarget).331-332-Either the [`stdout` option](#stdout-1) or the [`stderr` option](#stderr-1) must be kept as `pipe`, their default value. Also, the [`all` option](#all-2) must be set to `true`.333-282 ### execaSync(file, arguments?, options?)283 284 Execute a file synchronously.285 45 unmodified lines331 - 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.332 - the [`shell`](#shell) option cannot be used333 - an extra channel [`ipc`](https://nodejs.org/api/child_process.html#child_process_options_stdio) is passed to [`stdio`](#stdio)334 335+### childProcess336+337+This is both:338+ - a `Promise` resolving or rejecting with a [`childProcessResult`](#childProcessResult).339+ - a [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess) with the following additional methods and properties.340+341+#### kill(signal?, options?)342+343+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`.344+345+##### options.forceKillAfterTimeout346+347+Type: `number | false`\348+Default: `5000`349+350+Milliseconds to wait for the child process to terminate before sending `SIGKILL`.351+352+Can be disabled with `false`.353+354+#### all355+356+Type: `ReadableStream | undefined`357+358+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).359+360+This is `undefined` if either:361+ - the [`all` option](#all-2) is `false` (the default value)362+ - 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)363+364+#### pipeStdout(target)365+366+[Pipe](https://nodejs.org/api/stream.html#readablepipedestination-options) the child process's `stdout` to `target`, which can be:367+ - Another [`execa()` return value](#pipe-multiple-processes)368+ - A [writable stream](#save-and-pipe-output-from-a-child-process)369+ - A [file path string](#redirect-output-to-a-file)370+371+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).372+373+The [`stdout` option](#stdout-1) must be kept as `pipe`, its default value.374+375+#### pipeStderr(target)376+377+Like [`pipeStdout()`](#pipestdouttarget) but piping the child process's `stderr` instead.378+379+The [`stderr` option](#stderr-1) must be kept as `pipe`, its default value.380+381+#### pipeAll(target)382+383+Combines both [`pipeStdout()`](#pipestdouttarget) and [`pipeStderr()`](#pipestderrtarget).384+385+Either the [`stdout` option](#stdout-1) or the [`stderr` option](#stderr-1) must be kept as `pipe`, their default value. Also, the [`all` option](#all-2) must be set to `true`.386+387 ### childProcessResult388 389 Type: `object`390 421 unmodified lines