Re-order options in `readme.md` (#800)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by ehmicky · committed by GitHub · parent c8a7961 · Browse files · 1 file·+109 added−111 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+109 added−111 removed
- other:+109 added−111 removed
Provenance
- Commit
97caf72- Tree
ff5e512- Author
ehmicky <ehmicky@users.noreply.github.com>- Committer
GitHub <noreply@github.com>- Parent
c8a7961
1 file changed+109 added−111 removed
modified:readme.md+109 added-111 removed
480 unmodified lines481 ### options482 483 Type: `object`484 485-#### cleanup485+This lists all Execa options, including some options which are the same as for [`child_process#spawn()`](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options)/[`child_process#exec()`](https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback).486 487+#### reject488+489 Type: `boolean`\490 Default: `true`491 490-Kill the spawned process when the parent process exits unless either:491- - the spawned process is [`detached`](https://nodejs.org/api/child_process.html#child_process_options_detached)492- - the parent process is terminated abruptly, for example, with `SIGKILL` as opposed to `SIGTERM` or a normal exit492+Setting this to `false` resolves the promise with the error instead of rejecting it.493 494+#### shell495+496+Type: `boolean | string | URL`\497+Default: `false`498+499+If `true`, runs `file` inside of a shell. Uses `/bin/sh` on UNIX and `cmd.exe` on Windows. A different shell can be specified as a string. The shell should understand the `-c` switch on UNIX or `/d /s /c` on Windows.500+501+We recommend against using this option since it is:502+- not cross-platform, encouraging shell-specific syntax.503+- slower, because of the additional shell interpretation.504+- unsafe, potentially allowing command injection.505+506+#### cwd507+508+Type: `string | URL`\509+Default: `process.cwd()`510+511+Current working directory of the child process.512+513+#### env514+515+Type: `object`\516+Default: `process.env`517+518+Environment key-value pairs.519+520+Unless the [`extendEnv` option](#extendenv) is `false`, the child process also uses the current process' environment variables ([`process.env`](https://nodejs.org/api/process.html#processenv)).521+522+#### extendEnv523+524+Type: `boolean`\525+Default: `true`526+527+If `true`, the child process uses both the [`env` option](#env) and the current process' environment variables ([`process.env`](https://nodejs.org/api/process.html#processenv)).528+If `false`, only the `env` option is used, not `process.env`.529+530 #### preferLocal531 532 Type: `boolean`\533 Default: `true` with [`$`](#command), `false` otherwise20 unmodified lines554 Requires [`preferLocal`](#preferlocal) to be `true`.555 556 For example, this can be used together with [`get-node`](https://github.com/ehmicky/get-node) to run a specific Node.js version in a child process.557 558+#### nodePath *(For `.node()` only)*559+560+Type: `string | URL`\561+Default: [`process.execPath`](https://nodejs.org/api/process.html#process_process_execpath)562+563+Node.js executable used to create the child process.564+565+#### nodeOptions *(For `.node()` only)*566+567+Type: `string[]`\568+Default: [`process.execArgv`](https://nodejs.org/api/process.html#process_process_execargv)569+570+List of [CLI options](https://nodejs.org/api/cli.html#cli_options) passed to the Node.js executable.571+572+#### verbose573+574+Type: `boolean`\575+Default: `false`576+577+[Print each command](#verbose-mode) on `stderr` before executing it.578+579+This can also be enabled by setting the `NODE_DEBUG=execa` environment variable in the current process.580+581 #### buffer582 583 Type: `boolean`\584 Default: `true`109 unmodified lines694 - [`result.stdout`](#stdout), [`result.stderr`](#stderr), [`result.all`](#all-1) and [`result.stdio`](#stdio) are arrays of lines.695 - [`childProcess.stdout`](https://nodejs.org/api/child_process.html#subprocessstdout), [`childProcess.stderr`](https://nodejs.org/api/child_process.html#subprocessstderr), [`childProcess.all`](#all) and [`childProcess.stdio`](https://nodejs.org/api/child_process.html#subprocessstdio) iterate over lines instead of arbitrary chunks.696 - Any stream passed to the [`stdout`](#stdout-1), [`stderr`](#stderr-1) or [`stdio`](#stdio-1) option receives lines instead of arbitrary chunks.697 639-#### ipc698+#### encoding699 641-Type: `boolean`\642-Default: `true` with [`execaNode()`](#execanodescriptpath-arguments-options), `false` otherwise700+Type: `string`\701+Default: `utf8`702 644-Enables exchanging messages with the child process using [`childProcess.send(value)`](https://nodejs.org/api/child_process.html#subprocesssendmessage-sendhandle-options-callback) and [`childProcess.on('message', (value) => {})`](https://nodejs.org/api/child_process.html#event-message).703+Specify the character encoding used to decode the [`stdout`](#stdout), [`stderr`](#stderr) and [`stdio`](#stdio) output. If set to `'buffer'`, then `stdout`, `stderr` and `stdio` will be `Uint8Array`s instead of strings.704 646-#### reject647-648-Type: `boolean`\649-Default: `true`650-651-Setting this to `false` resolves the promise with the error instead of rejecting it.652-705 #### stripFinalNewline706 707 Type: `boolean`\708 Default: `true`709 710 Strip the final [newline character](https://en.wikipedia.org/wiki/Newline) from the output.711 660-#### extendEnv712+#### maxBuffer713 662-Type: `boolean`\663-Default: `true`714+Type: `number`\715+Default: `100_000_000` (100 MB)716 665-If `true`, the child process uses both the [`env` option](#env) and the current process' environment variables ([`process.env`](https://nodejs.org/api/process.html#processenv)).666-If `false`, only the `env` option is used, not `process.env`.717+Largest amount of data in bytes allowed on [`stdout`](#stdout), [`stderr`](#stderr) and [`stdio`](#stdio).718 668----719+#### ipc720 670-Execa also accepts the below options which are the same as the options for [`child_process#spawn()`](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options)/[`child_process#exec()`](https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback)721+Type: `boolean`\722+Default: `true` with [`execaNode()`](#execanodescriptpath-arguments-options), `false` otherwise723 672-#### cwd724+Enables exchanging messages with the child process using [`childProcess.send(value)`](https://nodejs.org/api/child_process.html#subprocesssendmessage-sendhandle-options-callback) and [`childProcess.on('message', (value) => {})`](https://nodejs.org/api/child_process.html#event-message).725 674-Type: `string | URL`\675-Default: `process.cwd()`676-677-Current working directory of the child process.678-679-#### env680-681-Type: `object`\682-Default: `process.env`683-684-Environment key-value pairs.685-686-Unless the [`extendEnv` option](#extendenv) is `false`, the child process also uses the current process' environment variables ([`process.env`](https://nodejs.org/api/process.html#processenv)).687-688-#### argv0689-690-Type: `string`691-692-Explicitly set the value of `argv[0]` sent to the child process. This will be set to `file` if not specified.693-726 #### serialization727 728 Type: `string`\729 Default: `'json'`9 unmodified lines739 Type: `boolean`740 741 Prepare child to run independently of its parent process. Specific behavior [depends on the platform](https://nodejs.org/api/child_process.html#child_process_options_detached).742 711-#### uid743+#### cleanup744 713-Type: `number`745+Type: `boolean`\746+Default: `true`747 715-Sets the user identity of the process.748+Kill the spawned process when the parent process exits unless either:749+ - the spawned process is [`detached`](https://nodejs.org/api/child_process.html#child_process_options_detached)750+ - the parent process is terminated abruptly, for example, with `SIGKILL` as opposed to `SIGTERM` or a normal exit751 717-#### gid718-719-Type: `number`720-721-Sets the group identity of the process.722-723-#### shell724-725-Type: `boolean | string | URL`\726-Default: `false`727-728-If `true`, runs `file` inside of a shell. Uses `/bin/sh` on UNIX and `cmd.exe` on Windows. A different shell can be specified as a string. The shell should understand the `-c` switch on UNIX or `/d /s /c` on Windows.729-730-We recommend against using this option since it is:731-- not cross-platform, encouraging shell-specific syntax.732-- slower, because of the additional shell interpretation.733-- unsafe, potentially allowing command injection.734-735-#### encoding736-737-Type: `string`\738-Default: `utf8`739-740-Specify the character encoding used to decode the [`stdout`](#stdout), [`stderr`](#stderr) and [`stdio`](#stdio) output. If set to `'buffer'`, then `stdout`, `stderr` and `stdio` will be `Uint8Array`s instead of strings.741-752 #### timeout753 754 Type: `number`\755 Default: `0`756 757 If `timeout`` is greater than `0`, the child process will be [terminated](#killsignal) if it runs for longer than that amount of milliseconds.758 749-#### maxBuffer759+#### signal760 751-Type: `number`\752-Default: `100_000_000` (100 MB)761+Type: [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal)762 754-Largest amount of data in bytes allowed on [`stdout`](#stdout), [`stderr`](#stderr) and [`stdio`](#stdio).763+You can abort the spawned process using [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController).764 756-#### killSignal765+When `AbortController.abort()` is called, [`.isCanceled`](#iscanceled) becomes `true`.766 758-Type: `string | number`\759-Default: `SIGTERM`760-761-Signal used to terminate the child process when:762-- using the [`signal`](#signal-1), [`timeout`](#timeout), [`maxBuffer`](#maxbuffer) or [`cleanup`](#cleanup) option763-- calling [`subprocess.kill()`](https://nodejs.org/api/child_process.html#subprocesskillsignal) with no arguments764-765-This can be either a name (like `"SIGTERM"`) or a number (like `9`).766-767 #### forceKillAfterDelay768 769 Type: `number | false`\770 Default: `5000`12 unmodified lines783 - sending a termination signal from another process784 785 Also, this does not work on Windows, because Windows [doesn't support signals](https://nodejs.org/api/process.html#process_signal_events): `SIGKILL` and `SIGTERM` both terminate the process immediately. Other packages (such as [`taskkill`](https://github.com/sindresorhus/taskkill)) can be used to achieve fail-safe termination on Windows.786 787-#### signal787+#### killSignal788 789-Type: [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal)789+Type: `string | number`\790+Default: `SIGTERM`791 791-You can abort the spawned process using [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController).792+Signal used to terminate the child process when:793+- using the [`signal`](#signal-1), [`timeout`](#timeout), [`maxBuffer`](#maxbuffer) or [`cleanup`](#cleanup) option794+- calling [`subprocess.kill()`](https://nodejs.org/api/child_process.html#subprocesskillsignal) with no arguments795 793-When `AbortController.abort()` is called, [`.isCanceled`](#iscanceled) becomes `true`.796+This can be either a name (like `"SIGTERM"`) or a number (like `9`).797 795-#### windowsVerbatimArguments798+#### argv0799 797-Type: `boolean`\798-Default: `false`800+Type: `string`801 800-If `true`, no quoting or escaping of arguments is done on Windows. Ignored on other platforms. This is set to `true` automatically when the `shell` option is `true`.802+Explicitly set the value of `argv[0]` sent to the child process. This will be set to `file` if not specified.803 802-#### windowsHide804+#### uid805 804-Type: `boolean`\805-Default: `true`806+Type: `number`807 807-On Windows, do not create a new console window. Please note this also prevents `CTRL-C` [from working](https://github.com/nodejs/node/issues/29837) on Windows.808+Sets the user identity of the process.809 809-#### verbose810+#### gid811 811-Type: `boolean`\812-Default: `false`812+Type: `number`813 814-[Print each command](#verbose-mode) on `stderr` before executing it.814+Sets the group identity of the process.815 816-This can also be enabled by setting the `NODE_DEBUG=execa` environment variable in the current process.816+#### windowsVerbatimArguments817 818-#### nodePath *(For `.node()` only)*818+Type: `boolean`\819+Default: `false`820 820-Type: `string | URL`\821-Default: [`process.execPath`](https://nodejs.org/api/process.html#process_process_execpath)821+If `true`, no quoting or escaping of arguments is done on Windows. Ignored on other platforms. This is set to `true` automatically when the `shell` option is `true`.822 823-Node.js executable used to create the child process.823+#### windowsHide824 825-#### nodeOptions *(For `.node()` only)*825+Type: `boolean`\826+Default: `true`827 827-Type: `string[]`\828-Default: [`process.execArgv`](https://nodejs.org/api/process.html#process_process_execargv)828+On Windows, do not create a new console window. Please note this also prevents `CTRL-C` [from working](https://github.com/nodejs/node/issues/29837) on Windows.829 830-List of [CLI options](https://nodejs.org/api/cli.html#cli_options) passed to the Node.js executable.831-830 ## Tips831 832 ### Redirect stdin/stdout/stderr to multiple destinations833 115 unmodified lines