Skip to content

Commit 499fe37

Browse files
authored
fix(deps): Update dependency execa to v9 (#848)
> ℹ️ **Note** > > This PR body was truncated due to platform limits. This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [execa](https://redirect.github.com/sindresorhus/execa) | [`8.0.1` → `9.6.1`](https://renovatebot.com/diffs/npm/execa/8.0.1/9.6.1) | ![age](https://developer.mend.io/api/mc/badges/age/npm/execa/9.6.1?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/execa/8.0.1/9.6.1?slim=true) | --- ### Release Notes <details> <summary>sindresorhus/execa (execa)</summary> ### [`v9.6.1`](https://redirect.github.com/sindresorhus/execa/releases/tag/v9.6.1) [Compare Source](https://redirect.github.com/sindresorhus/execa/compare/v9.6.0...v9.6.1) - Fix `VerboseOption` type not being properly exported ([#&#8203;1215](https://redirect.github.com/sindresorhus/execa/issues/1215)) [`7891c39`](https://redirect.github.com/sindresorhus/execa/commit/7891c39) *** ### [`v9.6.0`](https://redirect.github.com/sindresorhus/execa/releases/tag/v9.6.0) [Compare Source](https://redirect.github.com/sindresorhus/execa/compare/v9.5.3...v9.6.0) - Update dependencies [`d49104a`](https://redirect.github.com/sindresorhus/execa/commit/d49104a) *** ### [`v9.5.3`](https://redirect.github.com/sindresorhus/execa/releases/tag/v9.5.3) [Compare Source](https://redirect.github.com/sindresorhus/execa/compare/v9.5.2...v9.5.3) - Fix Node 24-specific deprecation warning ([#&#8203;1199](https://redirect.github.com/sindresorhus/execa/issues/1199)) [`1ac5b91`](https://redirect.github.com/sindresorhus/execa/commit/1ac5b91) *** ### [`v9.5.2`](https://redirect.github.com/sindresorhus/execa/releases/tag/v9.5.2) [Compare Source](https://redirect.github.com/sindresorhus/execa/compare/v9.5.1...v9.5.2) #### Bug fixes - Fix escaping newlines inside template strings. Thanks [@&#8203;aarondandy](https://redirect.github.com/aarondandy)! ([#&#8203;1176](https://redirect.github.com/sindresorhus/execa/issues/1176)) ### [`v9.5.1`](https://redirect.github.com/sindresorhus/execa/releases/tag/v9.5.1) [Compare Source](https://redirect.github.com/sindresorhus/execa/compare/v9.5.0...v9.5.1) #### Bug fixes - Fix odd characters being printed in `verbose` mode on Windows (thanks [@&#8203;IIIMADDINIII](https://redirect.github.com/IIIMADDINIII)). ([#&#8203;1167](https://redirect.github.com/sindresorhus/execa/issues/1167)) ### [`v9.5.0`](https://redirect.github.com/sindresorhus/execa/releases/tag/v9.5.0) [Compare Source](https://redirect.github.com/sindresorhus/execa/compare/v9.4.1...v9.5.0) #### Features - When redirecting `stdout` or `stderr` to a file, [allow appending](https://redirect.github.com/sindresorhus/execa/blob/main/docs/output.md#file-output) instead of overwriting. ([#&#8203;1166](https://redirect.github.com/sindresorhus/execa/issues/1166)) ```js await execa({stdout: {file: 'output.txt', append: true}})`npm run build`; ``` ### [`v9.4.1`](https://redirect.github.com/sindresorhus/execa/releases/tag/v9.4.1) [Compare Source](https://redirect.github.com/sindresorhus/execa/compare/v9.4.0...v9.4.1) #### Bug fixes - Fix using `process.execPath` with Deno. Thanks [@&#8203;w3cj](https://redirect.github.com/w3cj)! ([#&#8203;1160](https://redirect.github.com/sindresorhus/execa/issues/1160)) ### [`v9.4.0`](https://redirect.github.com/sindresorhus/execa/releases/tag/v9.4.0) [Compare Source](https://redirect.github.com/sindresorhus/execa/compare/v9.3.1...v9.4.0) #### Features - We've created a separate package called [nano-spawn](https://redirect.github.com/sindresorhus/nano-spawn). It is similar to Execa but with fewer features, for a much smaller package size. [More info.](https://redirect.github.com/sindresorhus/execa/blob/main/docs/small.md) #### Bug fixes - Both [`execaNode()`](https://redirect.github.com/sindresorhus/execa/blob/main/docs/node.md) and the [`preferLocal`](https://redirect.github.com/sindresorhus/execa/blob/main/docs/environment.md#local-binaries) option modify the `PATH` environment variable. This release includes some minor improvements to ensure that environment variable remains small ([sindresorhus/npm-run-path#20](https://redirect.github.com/sindresorhus/npm-run-path/pull/20)). It also handles a few related edge cases better ([sindresorhus/npm-run-path#21](https://redirect.github.com/sindresorhus/npm-run-path/pull/21)). #### Documentation - Small documentation typo fix, thanks [@&#8203;rrthomas](https://redirect.github.com/rrthomas)! ([#&#8203;1153](https://redirect.github.com/sindresorhus/execa/issues/1153)) ### [`v9.3.1`](https://redirect.github.com/sindresorhus/execa/releases/tag/v9.3.1) [Compare Source](https://redirect.github.com/sindresorhus/execa/compare/v9.3.0...v9.3.1) Thanks [@&#8203;holic](https://redirect.github.com/holic) and [@&#8203;jimhigson](https://redirect.github.com/jimhigson) for your contributions! #### Bugs - Do not crash when using a custom Node.js binary [without ICU support](https://nodejs.org/api/intl.html#disable-all-internationalization-features-none). ([#&#8203;1144](https://redirect.github.com/sindresorhus/execa/issues/1144)) #### Bugs (types) - Fix type of the [`env`](docs/api.md#optionsenv) option. It was currently failing for Remix or Next.js users. (by [@&#8203;holic](https://redirect.github.com/holic)) ([#&#8203;1141](https://redirect.github.com/sindresorhus/execa/issues/1141)) #### Documentation - Fix typo in "Inputs" documentation. (by [@&#8203;jimhigson](https://redirect.github.com/jimhigson)) ([#&#8203;1145](https://redirect.github.com/sindresorhus/execa/issues/1145)) - Document [how to terminate](docs/termination.md#inactivity-timeout) hanging subprocesses. ([#&#8203;1140](https://redirect.github.com/sindresorhus/execa/issues/1140)) - Document how to add [custom logging](readme.md#custom-logging). ([#&#8203;1131](https://redirect.github.com/sindresorhus/execa/issues/1131)) ### [`v9.3.0`](https://redirect.github.com/sindresorhus/execa/releases/tag/v9.3.0) [Compare Source](https://redirect.github.com/sindresorhus/execa/compare/v9.2.0...v9.3.0) #### Features - The [`verbose`](docs/api.md#optionsverbose) option can now be [a function](docs/api.md#verbose-function) to [customize logging](docs/debugging.md#custom-logging). ([#&#8203;1130](https://redirect.github.com/sindresorhus/execa/issues/1130)) ### [`v9.2.0`](https://redirect.github.com/sindresorhus/execa/releases/tag/v9.2.0) [Compare Source](https://redirect.github.com/sindresorhus/execa/compare/v9.1.0...v9.2.0) This release includes a [new set of methods](docs/ipc.md) to exchange messages between the current process and a Node.js subprocess, also known as "IPC". This allows [passing](docs/input.md#any-input-type) and [returning](docs/output.md#any-output-type) almost any message type to/from a Node.js subprocess. Also, [debugging](docs/ipc.md#debugging) IPC is now much easier. Moreover, a new [`gracefulCancel`](docs/api.md#optionsgracefulcancel) option has also been added to [terminate a subprocess gracefully](docs/termination.md#graceful-termination). For a deeper dive-in, please check and share the [release post](https://medium.com/@&#8203;ehmicky/ipc-made-easy-with-execa-9-2-939c6a358731)! Thanks [@&#8203;iiroj](https://redirect.github.com/iiroj) for your contribution, [@&#8203;SimonSiefke](https://redirect.github.com/SimonSiefke) and [@&#8203;adymorz](https://redirect.github.com/adymorz) for reporting the bugs fixed in this release, and [@&#8203;karlhorky](https://redirect.github.com/karlhorky) for improving the documentation! #### Deprecations - Passing `'ipc'` to the [`stdio`](docs/api.md#optionsstdio) option has been deprecated. It will be removed in the next major release. Instead, the [`ipc: true`](docs/api.md#optionsipc) option should be used. ([#&#8203;1056](https://redirect.github.com/sindresorhus/execa/issues/1056)) ```diff - await execa('npm', ['run', 'build'], {stdio: ['pipe', 'pipe', 'pipe', 'ipc']}); + await execa('npm', ['run', 'build'], {ipc: true}); ``` - The [`execaCommand()`](https://redirect.github.com/sindresorhus/execa/blob/v9.1.0/docs/api.md#execacommandcommand-options) method has been deprecated. It will be removed in the next major release. If most cases, the [template string syntax](docs/execution.md#template-string-syntax) should be used instead. ```diff - import {execaCommand} from 'execa'; + import {execa} from 'execa'; - await execaCommand('npm run build'); + await execa`npm run build`; const taskName = 'build'; - await execaCommand(`npm run ${taskName}`); + await execa`npm run ${taskName}`; const commandArguments = ['run', 'task with space']; await execa`npm ${commandArguments}`; ``` If the file and/or multiple arguments are supplied as a single string, [parseCommandString(command)](https://redirect.github.com/sindresorhus/execa/blob/main/docs/api.md#parsecommandstringcommand) can split that string into an array. [More info.](docs/escaping.md) ([#&#8203;1054](https://redirect.github.com/sindresorhus/execa/issues/1054)) ```diff - import {execaCommand} from 'execa'; + import {execa, parseCommandString} from 'execa'; const commandString = 'npm run task'; - await execaCommand(commandString); + const commandArray = parseCommandString(commandString); // ['npm', 'run', 'task'] + await execa`${commandArray}`; // Or alternatively: const [file, ...commandArguments] = commandArray; await execa(file, commandArguments); ``` #### Features - Add [`gracefulCancel`](docs/api.md#optionsgracefulcancel) option and [`getCancelSignal()`](docs/api.md#getcancelsignal) method to [terminate a subprocess gracefully](docs/termination.md#graceful-termination). [`error.isGracefullyCanceled`](docs/api.md#errorisgracefullycanceled) was also added. ([#&#8203;1109](https://redirect.github.com/sindresorhus/execa/issues/1109)) - Add [`error.isForcefullyTerminated`](docs/api.md#errorisforcefullyterminated). It is `true` when the subprocess was terminated by the [`forceKillAfterDelay`](docs/api.md#optionsforcekillafterdelay) option. ([#&#8203;1111](https://redirect.github.com/sindresorhus/execa/issues/1111)) - New methods to simplify exchanging messages between the current process and the subprocess. [More info.](docs/ipc.md) ([#&#8203;1059](https://redirect.github.com/sindresorhus/execa/issues/1059), [#&#8203;1061](https://redirect.github.com/sindresorhus/execa/issues/1061), [#&#8203;1076](https://redirect.github.com/sindresorhus/execa/issues/1076), [#&#8203;1077](https://redirect.github.com/sindresorhus/execa/issues/1077), [#&#8203;1079](https://redirect.github.com/sindresorhus/execa/issues/1079), [#&#8203;1082](https://redirect.github.com/sindresorhus/execa/issues/1082), [#&#8203;1083](https://redirect.github.com/sindresorhus/execa/issues/1083), [#&#8203;1086](https://redirect.github.com/sindresorhus/execa/issues/1086), [#&#8203;1087](https://redirect.github.com/sindresorhus/execa/issues/1087), [#&#8203;1088](https://redirect.github.com/sindresorhus/execa/issues/1088), [#&#8203;1089](https://redirect.github.com/sindresorhus/execa/issues/1089), [#&#8203;1090](https://redirect.github.com/sindresorhus/execa/issues/1090), [#&#8203;1091](https://redirect.github.com/sindresorhus/execa/issues/1091), [#&#8203;1092](https://redirect.github.com/sindresorhus/execa/issues/1092), [#&#8203;1094](https://redirect.github.com/sindresorhus/execa/issues/1094), [#&#8203;1095](https://redirect.github.com/sindresorhus/execa/issues/1095), [#&#8203;1098](https://redirect.github.com/sindresorhus/execa/issues/1098), [#&#8203;1104](https://redirect.github.com/sindresorhus/execa/issues/1104), [#&#8203;1107](https://redirect.github.com/sindresorhus/execa/issues/1107)) - The current process sends messages with [`subprocess.sendMessage(message)`](docs/api.md#subprocesssendmessagemessage-sendmessageoptions) and receives them with [`subprocess.getOneMessage()`](docs/api.md#subprocessgetonemessagegetonemessageoptions). [`subprocess.getEachMessage()`](docs/api.md#subprocessgeteachmessagegeteachmessageoptions) listens to multiple messages. - The subprocess uses [`sendMessage(message)`](docs/api.md#sendmessagemessage-sendmessageoptions), [`getOneMessage()`](docs/api.md#getonemessagegetonemessageoptions) and [`getEachMessage()`](docs/api.md#geteachmessagegeteachmessageoptions) instead. Those are the same methods, but imported directly from the `'execa'` module. - The [`ipcInput`](docs/ipc.md#send-an-initial-message) option sends an IPC message from the current process to the subprocess as it starts. This enables [passing almost any input type](docs/input.md#any-input-type) to a Node.js subprocess. ([#&#8203;1068](https://redirect.github.com/sindresorhus/execa/issues/1068)) - The [`result.ipcOutput`](docs/ipc.md#retrieve-all-messages) array contains all the IPC messages sent by the subprocess to the current process. This enables [returning almost any output type](docs/output.md#any-output-type) from a Node.js subprocess. ([#&#8203;1067](https://redirect.github.com/sindresorhus/execa/issues/1067), [#&#8203;1071](https://redirect.github.com/sindresorhus/execa/issues/1071), [#&#8203;1075](https://redirect.github.com/sindresorhus/execa/issues/1075)) - The [error message](docs/errors.md#error-message) now [contains every IPC message](docs/ipc.md#debugging) sent by the subprocess. ([#&#8203;1067](https://redirect.github.com/sindresorhus/execa/issues/1067)) - The [`verbose: 'full'`](docs/api.md#optionsverbose) option now logs every IPC message sent by the subprocess, for debugging. More info [here](docs/ipc.md#debugging) and [there](docs/output.md#stdoutstderr-specific-options). ([#&#8203;1063](https://redirect.github.com/sindresorhus/execa/issues/1063)) #### Types - Add [`ExecaMethod`](docs/typescript.md#available-types), [`ExecaNodeMethod`](docs/typescript.md#available-types) and [`ExecaScriptMethod`](docs/typescript.md#available-types), [`ExecaSyncMethod`](docs/typescript.md#synchronous-execution) and [`ExecaScriptSyncMethod`](docs/typescript.md#synchronous-execution) types. ([#&#8203;1066](https://redirect.github.com/sindresorhus/execa/issues/1066)) - Export the `Message` type, for [IPC](docs/ipc.md). ([#&#8203;1059](https://redirect.github.com/sindresorhus/execa/issues/1059)) - Fix type of `forceKillAfterDelay: true` option. ([#&#8203;1116](https://redirect.github.com/sindresorhus/execa/issues/1116)) #### Bug fixes - Fix passing a [`{file}`](docs/output.md#file-output) to both the [`stdin`](docs/api.md#optionsstdin) and the [`stdout`](docs/api.md#optionsstdout) or [`stderr`](docs/api.md#optionsstderr) options. ([#&#8203;1058](https://redirect.github.com/sindresorhus/execa/issues/1058)) - Fix multiple minor problems with the [`cancelSignal`](docs/termination.md#canceling) option. ([#&#8203;1108](https://redirect.github.com/sindresorhus/execa/issues/1108)) - Fix accidental publishing of Vim backup files. ([#&#8203;1074](https://redirect.github.com/sindresorhus/execa/issues/1074)) - Fix `engines.node` field in [`package.json`](package.json). Supported Node.js version is `^18.19.0` or `>=20.5.0`. (by [@&#8203;iiroj](https://redirect.github.com/iiroj)) ([#&#8203;1101](https://redirect.github.com/sindresorhus/execa/issues/1101)) ### [`v9.1.0`](https://redirect.github.com/sindresorhus/execa/releases/tag/v9.1.0) [Compare Source](https://redirect.github.com/sindresorhus/execa/compare/v9.0.2...v9.1.0) #### Features (types) - Export [`TemplateExpression`](docs/typescript.md#available-types) type. ([#&#8203;1049](https://redirect.github.com/sindresorhus/execa/issues/1049)) ### [`v9.0.2`](https://redirect.github.com/sindresorhus/execa/releases/tag/v9.0.2) [Compare Source](https://redirect.github.com/sindresorhus/execa/compare/v9.0.1...v9.0.2) #### Bug fixes (types) - Do not require using `--lib dom` for TypeScript users ([#&#8203;1043](https://redirect.github.com/sindresorhus/execa/issues/1043), [#&#8203;1044](https://redirect.github.com/sindresorhus/execa/issues/1044)) - Fix type of the `reject` option ([#&#8203;1046](https://redirect.github.com/sindresorhus/execa/issues/1046)) ### [`v9.0.1`](https://redirect.github.com/sindresorhus/execa/releases/tag/v9.0.1) [Compare Source](https://redirect.github.com/sindresorhus/execa/compare/v9.0.0...v9.0.1) #### Bug fixes (types) - Fix types not being importable ([#&#8203;1033](https://redirect.github.com/sindresorhus/execa/issues/1033)) [`3bdab60`](https://redirect.github.com/sindresorhus/execa/commit/3bdab60) - Fix complexity bug with types ([#&#8203;1037](https://redirect.github.com/sindresorhus/execa/issues/1037)) [`6cc519b`](https://redirect.github.com/sindresorhus/execa/commit/6cc519b) - Fix complexity bug with types ([#&#8203;1035](https://redirect.github.com/sindresorhus/execa/issues/1035)) [`fee011d`](https://redirect.github.com/sindresorhus/execa/commit/fee011d) ### [`v9.0.0`](https://redirect.github.com/sindresorhus/execa/releases/tag/v9.0.0) [Compare Source](https://redirect.github.com/sindresorhus/execa/compare/v8.0.1...v9.0.0) This major release brings many important features including: - [Split the output](https://medium.com/@&#8203;ehmicky/execa-9-release-d0d5daaa097f#3a26) into lines, or [progressively iterate](https://medium.com/@&#8203;ehmicky/execa-9-release-d0d5daaa097f#3a26) over them. - [Transform or filter](https://medium.com/@&#8203;ehmicky/execa-9-release-d0d5daaa097f#cbd6) the input/output using [simple functions](https://medium.com/@&#8203;ehmicky/execa-9-release-d0d5daaa097f#399a). - Print the output [to the terminal](https://medium.com/@&#8203;ehmicky/execa-9-release-d0d5daaa097f#693f) while still retrieving it programmatically. - Redirect the input/output [from/to a file](https://medium.com/@&#8203;ehmicky/execa-9-release-d0d5daaa097f#693f). - [Advanced piping](https://medium.com/@&#8203;ehmicky/execa-9-release-d0d5daaa097f#ec17) between multiple subprocesses. - Improved [verbose mode](https://medium.com/@&#8203;ehmicky/execa-9-release-d0d5daaa097f#2913), for debugging. - More [detailed errors](https://medium.com/@&#8203;ehmicky/execa-9-release-d0d5daaa097f#40d7), including when [terminating subprocesses](https://medium.com/@&#8203;ehmicky/execa-9-release-d0d5daaa097f#668c). - Enhanced [template string syntax](https://medium.com/@&#8203;ehmicky/execa-9-release-d0d5daaa097f#725b). - [Global/shared options](https://medium.com/@&#8203;ehmicky/execa-9-release-d0d5daaa097f#bcbf). - [Web streams](https://medium.com/@&#8203;ehmicky/execa-9-release-d0d5daaa097f#5731) and Transform streams support. - [Convert the subprocess](https://medium.com/@&#8203;ehmicky/execa-9-release-d0d5daaa097f#47b9) to a stream. - [New documentation](readme.md#documentation) with many examples. Please check the [release post](https://medium.com/@&#8203;ehmicky/execa-9-release-d0d5daaa097f) for a high-level overview! For the full list of breaking changes, features and bug fixes, please read below. Thanks [@&#8203;younggglcy](https://redirect.github.com/younggglcy), [@&#8203;koshic](https://redirect.github.com/koshic), [@&#8203;am0o0](https://redirect.github.com/am0o0) and [@&#8203;codesmith-emmy](https://redirect.github.com/codesmith-emmy) for your help! *** One of the maintainers [@&#8203;ehmicky](https://redirect.github.com/ehmicky) is looking for a remote full-time position. Specialized in Node.js back-ends and CLIs, he led Netlify [Build](https://www.netlify.com/platform/core/build/), [Plugins](https://www.netlify.com/integrations/) and Configuration for 2.5 years. Feel free to contact him on [his website](https://www.mickael-hebert.com) or on [LinkedIn](https://www.linkedin.com/in/mickaelhebert/)! *** #### Breaking changes (not types) - Dropped support for Node.js version `<18.19.0` and `20.0.0 - 20.4.0`. ([`834e372`](https://redirect.github.com/sindresorhus/execa/commit/834e3726)) - When the [`encoding` option](docs/api.md#optionsencoding) is `'buffer'`, the output ([`result.stdout`](docs/api.md#resultstdout), [`result.stderr`](docs/api.md#resultstderr), [`result.all`](docs/api.md#resultall)) is now an [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) instead of a [`Buffer`](https://nodejs.org/api/buffer.html#class-buffer). For more information, see [this blog post](https://sindresorhus.com/blog/goodbye-nodejs-buffer). (by [@&#8203;younggglcy](https://redirect.github.com/younggglcy)) ([#&#8203;586](https://redirect.github.com/sindresorhus/execa/issues/586)) ```js const {stdout} = await execa('node', ['file.js'], {encoding: 'buffer'}); console.log(stdout); // This is now an Uint8Array ``` - Renamed some of the allowed values for the [`encoding`](docs/api.md#optionsencoding) option. ([#&#8203;586](https://redirect.github.com/sindresorhus/execa/issues/586), [#&#8203;928](https://redirect.github.com/sindresorhus/execa/issues/928)) ```diff - await execa('node', ['file.js'], {encoding: null}); + await execa('node', ['file.js'], {encoding: 'buffer'}); - await execa('node', ['file.js'], {encoding: 'utf-8'}); + await execa('node', ['file.js'], {encoding: 'utf8'}); - await execa('node', ['file.js'], {encoding: 'UTF8'}); + await execa('node', ['file.js'], {encoding: 'utf8'}); - await execa('node', ['file.js'], {encoding: 'utf-16le'}); + await execa('node', ['file.js'], {encoding: 'utf16le'}); - await execa('node', ['file.js'], {encoding: 'ucs2'}); + await execa('node', ['file.js'], {encoding: 'utf16le'}); - await execa('node', ['file.js'], {encoding: 'ucs-2'}); + await execa('node', ['file.js'], {encoding: 'utf16le'}); - await execa('node', ['file.js'], {encoding: 'binary'}); + await execa('node', ['file.js'], {encoding: 'latin1'}); ``` - Passing a file path to `subprocess.pipeStdout()`, `subprocess.pipeStderr()` and `subprocess.pipeAll()` has been removed. Instead, a [`{file: './path'}` object](docs/output.md#file-output) should be passed to the [`stdout`](docs/api.md#optionsstdout) or [`stderr`](docs/api.md#optionsstderr) option. ([#&#8203;752](https://redirect.github.com/sindresorhus/execa/issues/752)) ```diff - await execa('node', ['file.js']).pipeStdout('output.txt'); + await execa('node', ['file.js'], {stdout: {file: 'output.txt'}}); - await execa('node', ['file.js']).pipeStderr('output.txt'); + await execa('node', ['file.js'], {stderr: {file: 'output.txt'}}); - await execa('node', ['file.js']).pipeAll('output.txt'); + await execa('node', ['file.js'], { + stdout: {file: 'output.txt'}, + stderr: {file: 'output.txt'}, +}); ``` - Passing a [writable stream](https://nodejs.org/api/stream.html#class-streamwritable) to `subprocess.pipeStdout()`, `subprocess.pipeStderr()` and `subprocess.pipeAll()` has been removed. Instead, the stream should be passed to the [`stdout`](docs/api.md#optionsstdout) or [`stderr`](docs/api.md#optionsstderr) option. If the stream [does not have a file descriptor](docs/streams.md#file-descriptors), [`['pipe', stream]`](docs/output.md#multiple-targets) should be passed instead. ([#&#8203;752](https://redirect.github.com/sindresorhus/execa/issues/752)) ```diff - await execa('node', ['file.js']).pipeStdout(stream); + await execa('node', ['file.js'], {stdout: ['pipe', stream]}); - await execa('node', ['file.js']).pipeStderr(stream); + await execa('node', ['file.js'], {stderr: ['pipe', stream]}); - await execa('node', ['file.js']).pipeAll(stream); + await execa('node', ['file.js'], { + stdout: ['pipe', stream], + stderr: ['pipe', stream], +}); ``` - The `subprocess.pipeStdout()`, `subprocess.pipeStderr()` and `subprocess.pipeAll()` methods have been renamed to [`subprocess.pipe()`](docs/api.md#subprocesspipefile-arguments-options). The command and its arguments can be passed to `subprocess.pipe()` directly, without calling `execa()` a second time. The [`from`](docs/api.md#pipeoptionsfrom) piping option can specify `'stdout'` (the default value), `'stderr'` or `'all'`. ([#&#8203;757](https://redirect.github.com/sindresorhus/execa/issues/757)) ```diff - await execa('node', ['file.js']).pipeStdout(execa('node', ['other.js'])); + await execa('node', ['file.js']).pipe('node', ['other.js']); - await execa('node', ['file.js']).pipeStderr(execa('node', ['other.js'])); + await execa('node', ['file.js']).pipe('node', ['other.js'], {from: 'stderr'}); - await execa('node', ['file.js']).pipeAll(execa('node', ['other.js'])); + await execa('node', ['file.js']).pipe('node', ['other.js'], {from: 'all'}); ``` - Renamed the `signal` option to [`cancelSignal`](docs/api.md#optionscancelsignal). ([#&#8203;880](https://redirect.github.com/sindresorhus/execa/issues/880)) ```diff - await execa('node', ['file.js'], {signal: abortController.signal}); + await execa('node', ['file.js'], {cancelSignal: abortController.signal}); ``` - Renamed `error.killed` to [`error.isTerminated`](docs/api.md#erroristerminated). ([#&#8203;625](https://redirect.github.com/sindresorhus/execa/issues/625)) ```diff try { await execa('node', ['file.js']); } catch (error) { - if (error.killed) { + if (error.isTerminated) { // ... } } ``` - `subprocess.cancel()` has been removed. Please use either [`subprocess.kill()`](docs/api.md#subprocesskillsignal-error) or the [`cancelSignal`](docs/api.md#optionscancelsignal) option instead. ([#&#8203;711](https://redirect.github.com/sindresorhus/execa/issues/711)) ```diff - subprocess.cancel(); + subprocess.kill(); ``` - Renamed the `forceKillAfterTimeout` option to [`forceKillAfterDelay`](docs/api.md#optionsforcekillafterdelay). Also, it is now passed to [`execa()`](docs/api.md#execafile-arguments-options) instead of [`subprocess.kill()`](docs/api.md#subprocesskillsignal-error). ([#&#8203;714](https://redirect.github.com/sindresorhus/execa/issues/714), [#&#8203;723](https://redirect.github.com/sindresorhus/execa/issues/723)) ```diff - const subprocess = execa('node', ['file.js']); - subprocess.kill('SIGTERM', {forceKillAfterTimeout: 1000}); + const subprocess = execa('node', ['file.js'], {forceKillAfterDelay: 1000}); + subprocess.kill('SIGTERM'); ``` - The [`verbose`](docs/api.md#optionsverbose) option is now a string enum instead of a boolean. `false` has been renamed to `'none'` and `true` has been renamed to [`'short'`](docs/debugging.md#short-mode). ([#&#8203;884](https://redirect.github.com/sindresorhus/execa/issues/884)) ```diff - await execa('node', ['file.js'], {verbose: false}); + await execa('node', ['file.js'], {verbose: 'none'}); - await execa('node', ['file.js'], {verbose: true}); + await execa('node', ['file.js'], {verbose: 'short'}); ``` - The `execPath` option has been renamed to [`nodePath`](docs/api.md#optionsnodepath). It is now a noop unless the [`node`](docs/api.md#optionsnode) option is `true`. Also, it now works even if the [`preferLocal`](docs/api.md#optionspreferlocal) option is `false`. ([#&#8203;812](https://redirect.github.com/sindresorhus/execa/issues/812), [#&#8203;815](https://redirect.github.com/sindresorhus/execa/issues/815)) ```diff - await execa('node', ['file.js'], {execPath: './path/to/node'}); + await execa('node', ['file.js'], {nodePath: './path/to/node'}); ``` - The [default value](docs/ipc.md#message-type) for the [`serialization`](docs/api.md#optionsserialization) option is now [`'advanced'`](https://nodejs.org/api/child_process.html#advanced-serialization) instead of `'json'`. In particular, when calling [`subprocess.send(object)`](docs/api.md#subprocesssendmessage) with an object that contains functions or symbols, those were previously silently removed. Now this will throw an exception. ([#&#8203;905](https://redirect.github.com/sindresorhus/execa/issues/905)) ```diff - subprocess.send({example: true, getExample() {}}); + subprocess.send({example: true}); ``` - If [`subprocess.stdout`](docs/api.md#subprocessstdout), [`subprocess.stderr`](docs/api.md#subprocessstderr) or [`subprocess.all`](docs/api.md#subprocessall) is manually piped, the [`.pipe()`](https://nodejs.org/api/stream.html#readablepipedestination-options) call must now happen as soon as `subprocess` is created. Otherwise, the output at the beginning of the subprocess might be missing. ([#&#8203;658](https://redirect.github.com/sindresorhus/execa/issues/658), [#&#8203;747](https://redirect.github.com/sindresorhus/execa/issues/747)) ```diff const subprocess = execa('node', ['file.js']); - setTimeout(() => { subprocess.stdout.pipe(process.stdout); - }, 0); ``` - Signals passed to [`subprocess.kill()`](docs/api.md#subprocesskillsignal-error) and to the [`killSignal`](docs/api.md#optionskillsignal) option cannot be lowercase anymore. ([#&#8203;1025](https://redirect.github.com/sindresorhus/execa/issues/1025)) ```diff - const subprocess = execa('node', ['file.js'], {killSignal: 'sigterm'}); + const subprocess = execa('node', ['file.js'], {killSignal: 'SIGTERM'}); - subprocess.kill('sigterm'); + subprocess.kill('SIGTERM'); ``` #### Features ##### Execution - Use the [template string syntax](docs/execution.md#template-string-syntax) with any method (including [`execa()`](docs/api.md#execacommand)), as opposed to only [`$`](docs/api.md#file-arguments-options). Conversely, `$` can now use the [regular array syntax](docs/scripts.md#template-string-syntax). ([#&#8203;933](https://redirect.github.com/sindresorhus/execa/issues/933)) - A command's template string can span [multiple lines](docs/execution.md#multiple-lines). ([#&#8203;843](https://redirect.github.com/sindresorhus/execa/issues/843)) - [Share options](docs/execution.md#globalshared-options) between multiple calls, or set global options, by using [`execa(options)`](docs/api#execaoptions). ([#&#8203;933](https://redirect.github.com/sindresorhus/execa/issues/933), [#&#8203;965](https://redirect.github.com/sindresorhus/execa/issues/965)) - Pass a file URL (as opposed to a file path string) to [`execa()`](docs/api.md#execafile-arguments-options), [`execaNode()`](docs/api.md#execanodescriptpath-arguments-options), the [`inputFile`](docs/api.md#optionsinputfile) option, the [`nodePath`](docs/api.md#optionsnodepath) option or the [`shell`](docs/api.md#optionsshell) option. ([#&#8203;630](https://redirect.github.com/sindresorhus/execa/issues/630), [#&#8203;631](https://redirect.github.com/sindresorhus/execa/issues/631), [#&#8203;632](https://redirect.github.com/sindresorhus/execa/issues/632), [#&#8203;635](https://redirect.github.com/sindresorhus/execa/issues/635)) ##### Text lines - [Split the output](docs/lines.md#simple-splitting) into text lines by using the [`lines`](docs/api.md#optionslines) option. ([#&#8203;741](https://redirect.github.com/sindresorhus/execa/issues/741), [#&#8203;929](https://redirect.github.com/sindresorhus/execa/issues/929), [#&#8203;931](https://redirect.github.com/sindresorhus/execa/issues/931), [#&#8203;948](https://redirect.github.com/sindresorhus/execa/issues/948), [#&#8203;951](https://redirect.github.com/sindresorhus/execa/issues/951), [#&#8203;957](https://redirect.github.com/sindresorhus/execa/issues/957)) - Subprocess is now an [async iterable](docs/api.md#subprocesssymbolasynciterator), [iterating over the output](docs/lines.md#progressive-splitting) lines while the subprocess is running. ([#&#8203;923](https://redirect.github.com/sindresorhus/execa/issues/923)) ##### Piping multiple subprocesses - Simpler syntax: pass the [command directly](docs/pipe.md#array-syntax) to [`subprocess.pipe()`](docs/api.md#subprocesspipefile-arguments-options) without calling [`execa()`](docs/api.md#execafile-arguments-options). A [template string](docs/pipe.md#template-string-syntax) can also be used. ([#&#8203;840](https://redirect.github.com/sindresorhus/execa/issues/840), [#&#8203;859](https://redirect.github.com/sindresorhus/execa/issues/859), [#&#8203;864](https://redirect.github.com/sindresorhus/execa/issues/864)) - [Wait for both subprocesses](docs/pipe.md#result) to complete. [Error handling](docs/pipe.md#errors) has been improved too. ([#&#8203;757](https://redirect.github.com/sindresorhus/execa/issues/757), [#&#8203;778](https://redirect.github.com/sindresorhus/execa/issues/778), [#&#8203;834](https://redirect.github.com/sindresorhus/execa/issues/834), [#&#8203;854](https://redirect.github.com/sindresorhus/execa/issues/854)) - Retrieve the [result](docs/pipe.md#result) of each subprocess (not only the last one) by using [`result.pipedFrom`](docs/api.md#resultpipedfrom) and [`error.pipedFrom`](docs/api.md#resultpipedfrom). ([#&#8203;834](https://redirect.github.com/sindresorhus/execa/issues/834)) - Pipe 1 or [many subprocesses](docs/pipe.md#multiple-sources-1-destination) to 1 or [many subprocesses](docs/pipe.md#1-source-multiple-destinations). ([#&#8203;834](https://redirect.github.com/sindresorhus/execa/issues/834)) - Pipe subprocesses using [other file descriptors](docs/pipe.md#source-file-descriptor) than `stdin`/`stdout`/`stderr` by using the [`from`](docs/api.md#pipeoptionsfrom) and [`to`](docs/api.md#pipeoptionsto) piping options. ([#&#8203;757](https://redirect.github.com/sindresorhus/execa/issues/757), [#&#8203;834](https://redirect.github.com/sindresorhus/execa/issues/834), [#&#8203;903](https://redirect.github.com/sindresorhus/execa/issues/903), [#&#8203;920](https://redirect.github.com/sindresorhus/execa/issues/920)) - [Cancel piping](docs/pipe.md#unpipe) subprocesses by using the [`unpipeSignal`](docs/api.md#pipeoptionsunpipesignal) piping option. ([#&#8203;834](https://redirect.github.com/sindresorhus/execa/issues/834), [#&#8203;852](https://redirect.github.com/sindresorhus/execa/issues/852)) ##### Input/output - Pass an array with [multiple values](docs/output.md#multiple-targets) to the [`stdin`](docs/api.md#optionsstdin), [`stdout`](docs/api.md#optionsstdout) and [`stderr`](docs/api.md#optionsstderr) options. For example, [`stdout: ['inherit', 'pipe']`](docs/output.md#multiple-targets) prints the output [to the terminal](docs/output.md#terminal-output) while still [returning it](docs/output.md#stdout-and-stderr) as [`result.stdout`](docs/api.md#resultstdout). ([#&#8203;643](https://redirect.github.com/sindresorhus/execa/issues/643), [#&#8203;765](https://redirect.github.com/sindresorhus/execa/issues/765), [#&#8203;941](https://redirect.github.com/sindresorhus/execa/issues/941), [#&#8203;954](https://redirect.github.com/sindresorhus/execa/issues/954)) - Redirect the [input](docs/input.md#file-input)/[output](docs/output.md#file-output) from/to a file by passing a `{file: './path'}` object or a file URL to the [`stdin`](docs/api.md#optionsstdin), [`stdout`](docs/api.md#optionsstdout) or [`stderr`](docs/api.md#optionsstderr) option. ([#&#8203;610](https://redirect.github.com/sindresorhus/execa/issues/610), [#&#8203;614](https://redirect.github.com/sindresorhus/execa/issues/614), [#&#8203;621](https://redirect.github.com/sindresorhus/execa/issues/621), [#&#8203;671](https://redirect.github.com/sindresorhus/execa/issues/671), [#&#8203;1004](https://redirect.github.com/sindresorhus/execa/issues/1004)) - [Transform](docs/transform.md) or [filter](docs/transform.md#filtering) the input/output by passing a generator function to the [`stdin`](docs/api.md#optionsstdin), [`stdout`](docs/api.md#optionsstdout) or [`stderr`](docs/api.md#optionsstderr) option. ([#&#8203;693](https://redirect.github.com/sindresorhus/execa/issues/693), [#&#8203;697](https://redirect.github.com/sindresorhus/execa/issues/697), [#&#8203;698](https://redirect.github.com/sindresorhus/execa/issues/698), [#&#8203;699](https://redirect.github.com/sindresorhus/execa/issues/699), [#&#8203;709](https://redirect.github.com/sindresorhus/execa/issues/709), [#&#8203;736](https://redirect.github.com/sindresorhus/execa/issues/736), [#&#8203;737](https://redirect.github.com/sindresorhus/execa/issues/737), [#&#8203;739](https://redirect.github.com/sindresorhus/execa/issues/739), [#&#8203;740](https://redirect.github.com/sindresorhus/execa/issues/740), [#&#8203;746](https://redirect.github.com/sindresorhus/execa/issues/746), [#&#8203;748](https://redirect.github.com/sindresorhus/execa/issues/748), [#&#8203;755](https://redirect.github.com/sindresorhus/execa/issues/755), [#&#8203;756](https://redirect.github.com/sindresorhus/execa/issues/756), [#&#8203;780](https://redirect.github.com/sindresorhus/execa/issues/780), [#&#8203;783](https://redirect.github.com/sindresorhus/execa/issues/783), [#&#8203;867](https://redirect.github.com/sindresorhus/execa/issues/867), [#&#8203;915](https://redirect.github.com/sindresorhus/execa/issues/915), [#&#8203;916](https://redirect.github.com/sindresorhus/execa/issues/916), [#&#8203;917](https://redirect.github.com/sindresorhus/execa/issues/917), [#&#8203;919](https://redirect.github.com/sindresorhus/execa/issues/919), [#&#8203;924](https://redirect.github.com/sindresorhus/execa/issues/924), [#&#8203;926](https://redirect.github.com/sindresorhus/execa/issues/926), [#&#8203;945](https://redirect.github.com/sindresorhus/execa/issues/945), [#&#8203;969](https://redirect.github.com/sindresorhus/execa/issues/969)) - Provide some [binary input](docs/binary.md#binary-input) by passing an [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) to the [`input`](docs/api.md#optionsinput) or [`stdin`](docs/api.md#optionsstdin) option. ([`834e372`](https://redirect.github.com/sindresorhus/execa/commit/834e3726), [#&#8203;670](https://redirect.github.com/sindresorhus/execa/issues/670), [#&#8203;1029](https://redirect.github.com/sindresorhus/execa/issues/1029)) - Provide some [progressive input](docs/streams.md#iterables-as-input) by passing a sync/async [iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) to the [`stdin`](docs/api.md#optionsstdin) option. ([#&#8203;604](https://redirect.github.com/sindresorhus/execa/issues/604), [#&#8203;944](https://redirect.github.com/sindresorhus/execa/issues/944)) - Provide [multiple inputs](docs/output.md#multiple-targets) by combining the [`stdin`](docs/api.md#optionsstdin), [`input`](docs/api.md#optionsinput) and [`inputFile`](docs/api.md#optionsinputfile) options. ([#&#8203;666](https://redirect.github.com/sindresorhus/execa/issues/666)) - Return [other file descriptors](docs/output.md#additional-file-descriptors) than [`result.stdout`](docs/api.md#resultstdout) and [`result.stderr`](docs/api.md#resultstderr) by using [`result.stdio`](docs/api.md#resultstdio). ([#&#8203;676](https://redirect.github.com/sindresorhus/execa/issues/676)) - [Specify different values](docs/output.md#stdoutstderr-specific-options) for [`stdout`](docs/api.md#optionsstdout) and [`stderr`](docs/api.md#optionsstderr) with the following options: [`verbose`](docs/api.md#optionsverbose), [`lines`](docs/api.md#optionslines), [`stripFinalNewline`](docs/api.md#optionsstripfinalnewline), [`maxBuffer`](docs/api.md#optionsmaxbuffer), [`buffer`](docs/api.md#optionsbuffer). ([#&#8203;966](https://redirect.github.com/sindresorhus/execa/issues/966), [#&#8203;970](https://redirect.github.com/sindresorhus/execa/issues/970), [#&#8203;971](https://redirect.github.com/sindresorhus/execa/issues/971), [#&#8203;972](https://redirect.github.com/sindresorhus/execa/issues/972), [#&#8203;973](https://redirect.github.com/sindresorhus/execa/issues/973), [#&#8203;974](https://redirect.github.com/sindresorhus/execa/issues/974)) ##### Streams - Redirect the input/output from/to a [web stream](docs/streams.md#web-streams) by passing a [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream) or [`WritableStream`](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream) to the [`stdin`](docs/api.md#optionsstdin), [`stdout`](docs/api.md#optionsstdout) or [`stderr`](docs/api.md#optionsstderr) option. ([#&#8203;615](https://redirect.github.com/sindresorhus/execa/issues/615), [#&#8203;619](https://redirect.github.com/sindresorhus/execa/issues/619), [#&#8203;645](https://redirect.github.com/sindresorhus/execa/issues/645)) - [Transform or filter](docs/transform.md#duplextransform-streams) the input/output by passing a [`Duplex`](https://nodejs.org/api/stream.html#class-streamduplex), Node.js [`Transform`](https://nodejs.org/api/stream.html#class-streamtransform) or web [`TransformStream`](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream) to the [`stdin`](docs/api.md#optionsstdin), [`stdout`](docs/api.md#optionsstdout) or [`stderr`](docs/api.md#optionsstderr) option. ([#&#8203;937](https://redirect.github.com/sindresorhus/execa/issues/937), [#&#8203;938](https://redirect.github.com/sindresorhus/execa/issues/938)) - [Convert the subprocess](docs/streams.md#converting-a-subprocess-to-a-stream) to a stream by using [`subprocess.readable()`](docs/api.md#subprocessreadablereadableoptions), [`subprocess.writable()`](docs/api.md#subprocesswritablewritableoptions) or [`subprocess.duplex()`](docs/api.md#subprocessduplexduplexoptions). ([#&#8203;912](https://redirect.github.com/sindresorhus/execa/issues/912), [#&#8203;922](https://redirect.github.com/sindresorhus/execa/issues/922), [#&#8203;958](https://redirect.github.com/sindresorhus/execa/issues/958)) ##### Verbose mode - Print the subprocess' [completion, duration and errors](docs/debugging.md#short-mode) with the [`verbose: 'short'`](docs/api.md#optionsverbose) or `verbose: 'full'` option. ([#&#8203;887](https://redirect.github.com/sindresorhus/execa/issues/887), [#&#8203;890](https://redirect.github.com/sindresorhus/execa/issues/890)) - Print the subprocess' [output](docs/debugging.md#full-mode) with the [`verbose: 'full'`](docs/api.md#optionsverbose) option. ([#&#8203;884](https://redirect.github.com/sindresorhus/execa/issues/884), [#&#8203;950](https://redirect.github.com/sindresorhus/execa/issues/950), [#&#8203;962](https://redirect.github.com/sindresorhus/execa/issues/962), [#&#8203;990](https://redirect.github.com/sindresorhus/execa/issues/990)) - Prettier formatting and [colors](docs/debugging.md#colors) with the [`verbose`](docs/api.md#optionsverbose) option. ([#&#8203;883](https://redirect.github.com/sindresorhus/execa/issues/883), [#&#8203;893](https://redirect.github.com/sindresorhus/execa/issues/893), [#&#8203;894](https://redirect.github.com/sindresorhus/execa/issues/894)) ##### Debugging - Retrieve the subprocess' [duration](docs/debugging.md#duration) by using [`result.durationMs`](docs/api.md#resultdurationms) and [`error.durationMs`](docs/api.md#resultdurationms). ([#&#8203;896](https://redirect.github.com/sindresorhus/execa/issues/896)) - Retrieve the subprocess' [current directory](docs/environment.md#current-directory) by using [`result.cwd`](docs/api.md#resultcwd). Previously only [`error.cwd`](docs/api.md#execaerror) was available. Also, `result.cwd` and `error.cwd` are now normalized to absolute file paths. ([#&#8203;803](https://redirect.github.com/sindresorhus/execa/issues/803)) - Printing [`result.escapedCommand`](docs/api.md#resultescapedcommand) in a terminal [is now safe](docs/debugging.md#command). ([#&#8203;875](https://redirect.github.com/sindresorhus/execa/issues/875)) ##### Errors - The [`ExecaError`](docs/api.md#execaerror) and [`ExecaSyncError`](docs/api.md#execasyncerror) classes [are now exported](docs/errors.md#subprocess-failure). ([#&#8203;911](https://redirect.github.com/sindresorhus/execa/issues/911)) - Find the subprocess failure's [root cause](docs/termination.md#error-message-and-stack-trace) by using [`error.cause`](docs/api.md#errorcause). ([#&#8203;911](https://redirect.github.com/sindresorhus/execa/issues/911)) - Know whether [the subprocess failed](docs/errors.md#failure-reason) due to the [`maxBuffer`](docs/api.md#optionsmaxbuffer) option by using [`error.isMaxBuffer`](docs/api.md#errorismaxbuffer). ([#&#8203;963](https://redirect.github.com/sindresorhus/execa/issues/963)) - Improved [`error.message`](docs/api.md#errormessage): [`error.stdout`](docs/api.md#resultstdout) and [`error.stderr`](docs/api.md#resultstderr) are now [interleaved](docs/output.md#interleaved-output) if the [`all`](docs/api.md#optionsall) option is `true`. [Additional file descriptors](docs/output.md#additional-file-descriptors) are now printed too. Also, the [formatting](docs/errors.md#error-message) has been improved. ([#&#8203;676](https://redirect.github.com/sindresorhus/execa/issues/676), [#&#8203;705](https://redirect.github.com/sindresorhus/execa/issues/705), [#&#8203;991](https://redirect.github.com/sindresorhus/execa/issues/991), [#&#8203;992](https://redirect.github.com/sindresorhus/execa/issues/992)) - [Control characters](https://en.wikipedia.org/wiki/Control_character) in [`error.message`](docs/api.md#errormessage) are now escaped, so they don't result in visual bugs when printed in a terminal. ([#&#8203;879](https://redirect.github.com/sindresorhus/execa/issues/879)) - Improved stack trace when an [`error`](https://nodejs.org/api/stream.html#event-error_1) event is emitted on [`subprocess.stdout`](docs/api.md#subprocessstdout) or [`subprocess.stderr`](docs/api.md#subprocessstderr). ([#&#8203;814](https://redirect.github.com/sindresorhus/execa/issues/814)) ##### Termination - Specify an [error message or stack trace](docs/termination.md#error-message-and-stack-trace) when terminating a subprocess by passing an error instance to [`subprocess.kill()`](docs/api.md#subprocesskillerror). ([#&#8203;811](https://redirect.github.com/sindresorhus/execa/issues/811), [#&#8203;836](https://redirect.github.com/sindresorhus/execa/issues/836), [#&#8203;1023](https://redirect.github.com/sindresorhus/execa/issues/1023)) - The [`forceKillAfterDelay`](docs/api.md#optionsforcekillafterdelay) and [`killSignal`](docs/api.md#optionskillsignal) options [now apply to terminations](docs/termination.md#default-signal) due not only to [`subprocess.kill()`](docs/api.md#subprocesskillsignal-error) but [also to](docs/termination.md#forceful-termination) the [`cancelSignal`](docs/api.md#optionscancelsignal), [`timeout`](docs/api.md#optionstimeout), [`maxBuffer`](docs/api.md#optionsmaxbuffer) and [`cleanup`](docs/api.md#optionscleanup) options. ([#&#8203;714](https://redirect.github.com/sindresorhus/execa/issues/714), [#&#8203;728](https://redirect.github.com/sindresorhus/execa/issues/728)) ##### Node.js files - Use the [`nodePath`](docs/api.md#optionsnodepath) and [`nodeOptions`](docs/api.md#optionsnodeoptions) options with [any method](docs/api.md#methods), as opposed to only [`execaNode()`](docs/api.md#execanodescriptpath-arguments-options), by passing the [`node: true`](docs/api.md#optionsnode) option. ([#&#8203;804](https://redirect.github.com/sindresorhus/execa/issues/804), [#&#8203;812](https://redirect.github.com/sindresorhus/execa/issues/812), [#&#8203;815](https://redirect.github.com/sindresorhus/execa/issues/815)) - When using [`execaNode()`](docs/api.md#execanodescriptpath-arguments-options) or the [`node: true`](docs/api.md#optionsnode) option, the [current Node.js version](docs/node.md#nodejs-version) is now inherited deeply. If the subprocess spawns other subprocesses, they will all use the [same Node.js version](docs/api.md#optionsnodepath). ([#&#8203;812](https://redirect.github.com/sindresorhus/execa/issues/812), [#&#8203;815](https://redirect.github.com/sindresorhus/execa/issues/815), [#&#8203;1011](https://redirect.github.com/sindresorhus/execa/issues/1011)) ##### Synchronous execution - Use the [`all`](docs/api.md#optionsall) and [`buffer: false`](docs/api.md#optionsbuffer) options with [`execaSync()`](docs/api.md#execasyncfile-arguments-options), as opposed to only [`execa()`](docs/api.md#execafile-arguments-options). ([#&#8203;953](https://redirect.github.com/sindresorhus/execa/issues/953), [#&#8203;956](https://redirect.github.com/sindresorhus/execa/issues/956)) - Added the [`$.s`](docs/api.md#file-arguments-options) alias for [`$.sync`](docs/api.md#file-arguments-options). ([#&#8203;594](https://redirect.github.com/sindresorhus/execa/issues/594)) ##### Inter-process communication - Use the [`ipc: true`](docs/api.md#optionsipc) option, as [opposed to the more verbose](docs/ipc.md#exchanging-messages) [`stdio: ['pipe', 'pipe', 'pipe', 'ipc']`](docs/api.md#optionsstdio) option. ([#&#8203;794](https://redirect.github.com/sindresorhus/execa/issues/794)) ##### Input validation - Improved the validation of the [`input`](docs/api.md#optionsinput), [`timeout`](docs/api.md#optionstimeout), [`cwd`](docs/api.md#optionscwd), [`detached`](docs/api.md#optionsdetached), [`cancelSignal`](docs/api.md#optionscancelsignal) and [`encoding`](docs/api.md#optionsencoding) options. ([#&#8203;668](https://redirect.github.com/sindresorhus/execa/issues/668), [#&#8203;715](https://redirect.github.com/sindresorhus/execa/issues/715), [#&#8203;803](https://redirect.github.com/sindresorhus/execa/issues/803), [#&#8203;928](https://redirect.github.com/sindresorhus/execa/issues/928), [#&#8203;940](https://redirect.github.com/sindresorhus/execa/issues/940)) - Improved the validation of the arguments passed to [`execa()`](docs/api.md#execafile-arguments-options) and the [other exported methods](docs/api.md#methods). ([#&#8203;838](https://redirect.github.com/sindresorhus/execa/issues/838), [#&#8203;873](https://redirect.github.com/sindresorhus/execa/issues/873), [#&#8203;899](https://redirect.github.com/sindresorhus/execa/issues/899)) - Improved the validation of signals passed to [`subprocess.kill()`](docs/api.md#subprocesskillsignal-error) and to the [`killSignal`](docs/api.md#optionskillsignal) option. ([#&#8203;1025](https://redirect.github.com/sindresorhus/execa/issues/1025)) #### Bug fixes - Fixed passing `undefined` values as [options](docs/api.md#options). This now uses the option's default value. ([#&#8203;712](https://redirect.github.com/sindresorhus/execa/issues/712)) - Fixed the process crashing when the [`inputFile`](docs/api.md#optionsinputfile) option points to a missing file. ([#&#8203;609](https://redirect.github.com/sindresorhus/execa/issues/609)) - Fixed the process crashing when the [`buffer`](docs/api.md#optionsbuffer) option is `false` and [`subprocess.stdout`](docs/api.md#subprocessstdout) [errors](https://nodejs.org/api/stream.html#event-error_1). ([#&#8203;729](https://redirect.github.com/sindresorhus/execa/issues/729)) - Fixed the process crashing when passing [`'overlapped'`](docs/windows.md#asynchronous-io) to the [`stdout`](docs/api.md#optionsstdout) or [`stderr`](docs/api.md#optionsstderr) option with [`execaSync()`](docs/api.md#execasyncfile-arguments-options). ([#&#8203;949](https://redirect.github.com/sindresorhus/execa/issues/949)) - Fixed the process crashing when multiple [`'error'`](https://nodejs.org/api/child_process.html#event-error) events are emitted on the subprocess. ([#&#8203;790](https://redirect.github.com/sindresorhus/execa/issues/790)) - Fixed the [`reject: false`](docs/api.md#optionsreject) option not being used when the subprocess [fails to spawn](docs/errors.md#failure-reason). ([#&#8203;734](https://redirect.github.com/sindresorhus/execa/issues/734)) - Fixed [some inaccuracies](docs/errors.md#failure-reason) with [`error.isTerminated`](docs/api.md#erroristerminated). ([#&#8203;625](https://redirect.github.com/sindresorhus/execa/issues/625), [#&#8203;719](https://redirect.github.com/sindresorhus/execa/issues/719)) - It is now `true` when the subprocess fails due to the [`timeout`](docs/api.md#optionstimeout) option. - It is now `true` when calling [`process.kill(subprocess.pid)`](https://nodejs.org/api/process.html#processkillpid-signal), except on Windows. - It is now `false` when using [non-terminating signals](https://nodejs.org/api/child_process.html#subprocesskillsignal) such as `subprocess.kill(0)`. - Fixed missing [`error.signal`](docs/api.md#errorsignal) and [`error.signalDescription`](docs/api.md#errorsignaldescription) when the subprocess [is terminated](docs/termination.md#canceling) by the [`cancelSignal`](docs/api.md#optionscancelsignal) option. ([#&#8203;724](https://redirect.github.com/sindresorhus/execa/issues/724)) - Fixed a situation where the [error](docs/api.md#execaerror) returned by an [`execa()`](docs/api.md#execafile-arguments-options) call might be modified by another `execa()` call. ([#&#8203;796](https://redirect.github.com/sindresorhus/execa/issues/796), [#&#8203;806](https://redirect.github.com/sindresorhus/execa/issues/806), [#&#8203;911](https://redirect.github.com/sindresorhus/execa/issues/911)) - Fixed the [`verbose`](docs/api.md#optionsverbose) option [printing the command](docs/debugging.md#short-mode) in the wrong order. ([#&#8203;600](https://redirect.github.com/sindresorhus/execa/issues/600)) - Fixed using both the [`maxBuffer`](docs/api.md#optionsmaxbuffer) and [`encoding`](docs/api.md#optionsencoding) options. For example, when using [`encoding: 'hex'`](docs/binary.md#encoding), `maxBuffer` will now be measured in hexadecimal characters. Also, [`error.stdout`](docs/api.md#resultstdout), [`error.stderr`](docs/api.md#resultstderr) and [`error.all`](docs/api.md#resultall) were previously not applying the `maxBuffer` option. ([#&#8203;652](https://redirect.github.com/sindresorhus/execa/issues/652), [#&#8203;696](https://redirect.github.com/sindresorhus/execa/issues/696)) - Fixed the [`maxBuffer`](docs/api.md#optionsmaxbuffer) option [not truncating](docs/output.md#big-output) [`result.stdout`](docs/api.md#resultstdout) and [`result.stderr`](docs/api.md#resultstderr) when using [`execaSync()`](docs/api.md#execasyncfile-arguments-options). ([#&#8203;960](https://redirect.github.com/sindresorhus/execa/issues/960)) - Fixed empty output when using the [`buffer: true`](docs/api.md#optionsbuffer) option (its default value) and [iterating](https://nodejs.org/api/stream.html#readablesymbolasynciterator) over [`subprocess.stdout`](docs/api.md#subprocessstdout) or [`subprocess.stderr`](docs/api.md#subprocessstderr). ([#&#8203;908](https://redirect.github.com/sindresorhus/execa/issues/908)) - Fixed [`subprocess.all`](docs/api.md#subprocessall) stream incorrectly being in [object mode](https://nodejs.org/api/stream.html#object-mode). ([#&#8203;717](https://redirect.github.com/sindresorhus/execa/issues/717)) - Ensured [`subprocess.stdout`](docs/api.md#subprocessstdout) and [`subprocess.stderr`](docs/api.md#subprocessstderr) are properly [flushed](https://nodejs.org/api/stream.html#buffering) when the subprocess fails. ([#&#8203;647](https://redirect.github.com/sindresorhus/execa/issues/647)) - Fixed a race condition leading to random behavior with the [`timeout`](docs/api.md#optionstimeout) option. ([#&#8203;727](https://redirect.github.com/sindresorhus/execa/issues/727)) #### Breaking changes (types) - The minimum supported TypeScript version is now [`5.1.6`](https://redirect.github.com/microsoft/TypeScript/releases/tag/v5.1.6). - Renamed `CommonOptions` type to [`Options`](types/arguments/options.d.ts) (for [`execa()`](docs/api.md#execafile-arguments-options)) and [`SyncOptions`](types/arguments/options.d.ts) (for [`execaSync()`](docs/api.md#execasyncfile-arguments-options)). ([#&#8203;678](https://redirect.github.com/sindresorhus/execa/issues/678), [#&#8203;682](https://redirect.github.com/sindresorhus/execa/issues/682)) ```diff import type {Options} from 'execa'; - const options: CommonOptions = {timeout: 1000}; + const options: Options = {timeout: 1000}; ``` - Renamed `NodeOptions` type to [`Options`](types/arguments/options.d.ts). ([#&#8203;804](https://redirect.github.com/sindresorhus/execa/issues/804)) ```diff import type {Options} from 'execa'; - const options: NodeOptions = {nodeOptions: ['--no-warnings']}; + const options: Options = {nodeOptions: ['--no-warnings']}; ``` - Renamed `KillOptions` type to [`Options`](types/arguments/options.d.ts). ([#&#8203;714](https://redirect.github.com/sindresorhus/execa/issues/714)) ```diff import type {Options} from 'execa'; - const options: KillOptions = {forceKillAfterTimeout: 1000}; + const options: Options = {forceKillAfterDelay: 1000}; ``` - Removed generic parameters from the [`Options`](types/arguments/options.d.ts) and [`SyncOptions`](types/arguments/options.d.ts) types. ([#&#8203;681](https://redirect.github.com/sindresorhus/execa/issues/681)) ```diff import type {Options} from 'execa'; - const options: Options<'utf8'> = {encoding: 'utf8'}; + const options: Options = {encoding: 'utf8'}; ``` - Renamed `ExecaChildProcess` type to [`ResultPromise`](types/subprocess/subprocess.d.ts). This is the type of [`execa()`](docs/api.md#execafile-arguments-options)'s [return value](docs/api.md#return-value), which is both a [`Promise<Result>`](docs/api.md#result) and a [`Subprocess`](docs/api.md#subprocess). ([#&#8203;897](https://redirect.github.com/sindresorhus/execa/issues/897), [#&#8203;1007](https://redirect.github.com/sindresorhus/execa/issues/1007), [#&#8203;1009](https://redirect.github.com/sindresorhus/execa/issues/1009)) ```diff import type {ResultPromise, Result} from 'execa'; - const promiseOrSubprocess: ExecaChildProcess = execa('node', ['file.js']); + const promiseOrSubprocess: ResultPromise = execa('node', ['file.js']); const result: Result = </details> --- ### Configuration 📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM, on day 1 of the month ( * 0-3 1 * * ) (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://redirect.github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My42My4wIiwidXBkYXRlZEluVmVyIjoiNDMuNjMuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
1 parent ab54d16 commit 499fe37

File tree

2 files changed

+191
-125
lines changed

2 files changed

+191
-125
lines changed

0 commit comments

Comments
 (0)