| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| README.md | 2026-07-17 | 4.7 kB | |
| v10.0.0 source code.tar.gz | 2026-07-17 | 345.5 kB | |
| v10.0.0 source code.zip | 2026-07-17 | 604.9 kB | |
| Totals: 3 Items | 955.1 kB | 0 | |
Breaking
-
Require Node.js 22. (#1243) 04b4454
-
The subprocess is now a normal promise, instead of a
ChildProcessinstance augmented with promise methods. All the methods and properties documented by Execa are unchanged. Node.js-specificChildProcessAPIs (such as.on(),.send(),.ref()and.unref()) must now be accessed through the newsubprocess.nodeChildProcessproperty. (#1255) ade74bf:::diff const subprocess = execa('node', ['file.js']);
- subprocess.on('spawn', onSpawn);
- subprocess.nodeChildProcess.on('spawn', onSpawn);
-
Removed
execaCommand()andexecaCommandSync(). Use the template string syntax instead, which splits on spaces. If the command is a dynamic string, split it withparseCommandString(). (#1244) 3ced394:::diff
- await execaCommand('npm run build');
-
await execa
npm run build; -
await execaCommand(commandString);
- await execa
${parseCommandString(commandString)};
-
Removed the old undocumented
stdio: [..., 'ipc']syntax. Use theipc: trueoption instead. (#1245) dcf611c:::diff
- await execa('node', ['file.js'], {stdio: ['pipe', 'pipe', 'pipe', 'ipc']});
- await execa('node', ['file.js'], {ipc: true});
-
When the
inputorinputFileoption is combined with an inheritedstdin(for examplestdio: 'inherit'), the explicit input is now used, instead of being ignored. To combine multiple inputs, pass an array likestdin: ['inherit', {string: 'input'}]. (#1232) 3ed0544
Improvements
-
Terminate the subprocess' descendant processes by using the
killDescendantsoption. This is useful when the subprocess spawns its own processes, such as when using theshelloption. (#1256) 84fa0ec:::js await execa('npm', ['run', 'build'], {killDescendants: true, timeout: 5000});
-
Convert the subprocess to a web stream by using
subprocess.readableStream(),subprocess.writableStream()orsubprocess.transformStream(). (#1254) 29d9cfc:::js await execa
npm run build.readableStream() .pipeTo(writableWebStream); -
The value returned by
subprocess.pipe()now exposes the destination subprocess' methods, so the piped output can be consumed directly: iterate over its output lines, convert it to a stream, or exchange IPC messages. (#1252) c31c94c:::js for await (const line of execa
npm run build.pipesort) { console.log(line); } -
Use an additional file descriptor as input by wrapping its
stdiovalue as a{value, input: true}object. Direction-ambiguous values ('pipe','inherit', files and transforms) default to output on additional file descriptors. (#1246, [#1249]) 487a3a4 9fbf5ba:::js const subprocess = execa({stdio: ['pipe', 'pipe', 'pipe', {value: 'pipe', input: true}]})
npm run scaffold;const writable = subprocess.writable({to: 'fd3'});
-
The transform generator function's
chunkargument is now typed based on the transform's mode, instead of always beingunknown:stringfor line transforms,Uint8Arrayfor binary transforms, andunknownin object mode. (#1247) 0a7b4f8
Fixes
- Fixed fd-specific options (
verbose,maxBuffer, etc.) when theipcoption istrue:fd3andipcno longer target the same file descriptor. (#1241) b886883
https://github.com/sindresorhus/execa/compare/v9.6.1...v10.0.0