Bot releases are hidden (Show)
{encoding: 'buffer'}
option. It is the same as {encoding: null}
, but preferred over it. (#572)https://github.com/sindresorhus/execa/compare/v8.0.0...v8.0.1
https://github.com/sindresorhus/execa/compare/v7.2.0...v8.0.0
cwd
error property (#565) f57fdechttps://github.com/sindresorhus/execa/compare/v7.1.1...v7.2.0
$.sync(options)`command`
is used instead of $(options).sync`command`
(#551)$`command argument${value}`
(#553)stdin
option when using $`command`
: it should be inherit
(#550)$
method to write Node.js scripts like zx. For more information, please see this blog post, this section and this page. Thanks @aaronccasanova for this great feature!import {$} from 'execa';
const branch = await $`git branch --show-current`;
await $`dep deploy --branch=${branch}`;
.pipeStdout()
, .pipeStderr()
and .pipeAll()
methods to redirect stdout
/stderr
to a file, a stream or another process.// Similar to `echo unicorns > stdout.txt` in Bash
await execa('echo', ['unicorns']).pipeStdout('stdout.txt');
// Similar to `echo unicorns 2> stdout.txt` in Bash
await execa('echo', ['unicorns']).pipeStderr('stderr.txt');
// Similar to `echo unicorns &> stdout.txt` in Bash
await execa('echo', ['unicorns'], {all: true}).pipeAll('all.txt');
inputFile
option to use a file as stdin
.// Similar to `cat < stdin.txt` in Bash
const {stdout} = await execa('cat', {inputFile: 'stdin.txt'});
console.log(stdout);
//=> 'unicorns'
verbose
option to print each command on stderr
before executing it. This can also be enabled by setting the NODE_DEBUG=execa
environment variable in the current process.> node file.js
unicorns
rainbows
> NODE_DEBUG=execa node file.js
[16:50:03.305] echo unicorns
unicorns
[16:50:03.308] echo rainbows
rainbows
end
event on streams when process fails (#518) 30c7a7aexecaNode
signature in index.d.ts
(#506) 1f7677chttps://github.com/sindresorhus/execa/compare/v6.1.0...v7.0.0
AbortController
(#490) c6e791acwd
and localDir
options to be URLs (#492) 93ab929https://github.com/sindresorhus/execa/compare/v6.0.0...v6.1.0
require('execa')
→ import {execa} from 'execa'
require('execa').sync
→ import {execaSync} from 'execa'
require('execa').command
→ import {execaCommand} from 'execa'
require('execa').commandSync
→ import {execaCommandSync} from 'execa'
require('execa').node
→ import {execaNode} from 'execa'
https://github.com/sindresorhus/execa/compare/v5.1.1...v6.0.0
https://github.com/sindresorhus/execa/compare/v5.1.0...v5.1.1
.escapedCommand
property to the results (#466) 712bafchttps://github.com/sindresorhus/execa/compare/v5.0.1...v5.1.0
timeout
option validation (#463) 427c5c2https://github.com/sindresorhus/execa/compare/v5.0.0...v5.0.1
https://github.com/sindresorhus/execa/compare/v4.1.0...v5.0.0
--inspect
& --inspect-brk
from execArgv
(#435) 8fd3f64https://github.com/sindresorhus/execa/compare/v4.0.3...v4.1.0
timeout
and forceKillAfterTimeout
options (#431) 9a157b3https://github.com/sindresorhus/execa/compare/v4.0.2...v4.0.3
stderr
and stdout
to error.message
. A new property error.shortMessage
is now available to retrieve the error message without stderr
nor stdout
(#397)childProcess.kill()
not working with Electron (#400)serialization
option. That option was added to child_process
methods in Node.js 13.2.0
. (#392)windowsHide
option (#388). The option still defaults to true
. However previously it could not be set to false
.Thanks @justsml for helping improving the documentation!
error.signalDescription
which is a human-friendly description of the signal that terminated the child process (if one did). That description is included in error messages as well. (#378)