Skip to content
Myr

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

1 file+52 added−52 removed

modified:readme.md+52 added-52 removed
277 unmodified lines
278No escaping/quoting is needed.279280Unless 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.281282### childProcess283284This 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.287288#### kill(signal?, options?)289290Same 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`.291292##### options.forceKillAfterTimeout293294Type: `number | false`\295Default: `5000`296297Milliseconds to wait for the child process to terminate before sending `SIGKILL`.298299Can be disabled with `false`.300301#### all302303Type: `ReadableStream | undefined`304305Stream 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).306307This 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)310311#### pipeStdout(target)312313[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)317318If 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).319320The [`stdout` option](#stdout-1) must be kept as `pipe`, its default value.321322#### pipeStderr(target)323324Like [`pipeStdout()`](#pipestdouttarget) but piping the child process's `stderr` instead.325326The [`stderr` option](#stderr-1) must be kept as `pipe`, its default value.327328#### pipeAll(target)329330Combines both [`pipeStdout()`](#pipestdouttarget) and [`pipeStderr()`](#pipestderrtarget).331332Either 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`.333282### execaSync(file, arguments?, options?)283284Execute a file synchronously.285
45 unmodified lines
331 - 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)334335### childProcess336337This 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.340341#### kill(signal?, options?)342343Same 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`.344345##### options.forceKillAfterTimeout346347Type: `number | false`\348Default: `5000`349350Milliseconds to wait for the child process to terminate before sending `SIGKILL`.351352Can be disabled with `false`.353354#### all355356Type: `ReadableStream | undefined`357358Stream 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).359360This 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)363364#### pipeStdout(target)365366[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)370371If 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).372373The [`stdout` option](#stdout-1) must be kept as `pipe`, its default value.374375#### pipeStderr(target)376377Like [`pipeStdout()`](#pipestdouttarget) but piping the child process's `stderr` instead.378379The [`stderr` option](#stderr-1) must be kept as `pipe`, its default value.380381#### pipeAll(target)382383Combines both [`pipeStdout()`](#pipestdouttarget) and [`pipeStderr()`](#pipestderrtarget).384385Either 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`.386387### childProcessResult388389Type: `object`390
421 unmodified lines