v2.0.0
Thanks to @GMartigny, @BendingBender, @tomsotte, @ammarbinfaisal, @zokker13, @stroncium, @satyarohith, @bradfordlemley, @coreyfarrell, @brandon93s, @dtinth, @papb for the great features and bug fixes they've contributed!
Please check the Medium article about this release!
Breaking changes
- Drop support for Node.js 6 (dce22670, #221)
- Remove
execa.shell()
andexeca.shellSync()
. Theshell
option should be used instead. (#219) - Remove
execa.stdout()
andexeca.stderr()
.childProcessResult.stdout
andchildProcessResult.stderr
should be used instead (#234) - Remove
error.code
(number
orstring
) in favor oferror.exitCode
(number
) anderror.exitCodeName
(string
) (#187, #250) - Rename
stripeEof
option tostripFinalNewline
(f8397ba9, 4d0dc88a, #238) - Rename
cmd
(inchildProcessResult
anderror
) tocommand
(#194) - Default
preferLocal
option tofalse
. If you are executing locally installed binaries, you'll need to manually specifypreferLocal: true
(#314) - Ensure
windowsHide
option is alwaystrue
, so that no window pops up on Windows. (8c886452) error.signal
is nowundefined
instead ofnull
when no signal was used (#193)- Set
error.killed
tofalse
when child process timed out (#227) - Make
error.killed
always boolean (notundefined
) (#229, #248) - Ensure errors always have the same shape. (#276, #277, #283)
error.stdout
anderror.stderr
are now an empty string (instead ofnull
) when the command failed. (#246)
Features
- Add TypeScript definition (#188, f2cb86ff, 7702b8ef, 4692dcd4, #251)
- Add
execa.command()
andexeca.commandSync()
. Those are the same asexeca()
except both file and arguments are specified in a single string. For example,execa('echo', ['unicorns'])
is the same asexeca.command('echo unicorns')
(#182, #261, #262, #278, #279, #282) - Retrieve interleaved stdout and stderr with
childProcess.all
andchildProcessResult.all
(#171, #264) - Add
execa.node()
which (likechild_process.fork()
) allows you to execute a Node.js script as a child process (#200, #297, #299, #302, #303, #305, #306). - If
childProcess.kill()
does not terminate a child process after 5 seconds, force it by sendingSIGKILL
. This can be configured using theforceKillAfterTimeout
option. (#208, #272, #273, #280, #284, #285) - Add
childProcess.cancel()
anderror.isCanceled
(#189, f24e7c72, #226, #309) error.stdout
,error.stderr
anderror.all
now contain the data that was sent before the child process exit. (#271)- Improve
error.message
on child process failure (#180, #223, #230, #245, #269) - Add
.finally()
to the child process promise (#174, 65139849) - Increase
maxBuffer
option default value from10 MB
to100 MB
(#286)
Bug fixes
- Fix
timeout
option not working as expected (#199) - Fix
error.timedOut
not working withexeca.sync()
(#249) - Fix
maxBuffer
errors not using the same shape as the other errors (#266) - Fix
extendEnd
option not working withshell
option (#184) - Fix
stripFinalNewline
option not applied on error properties (#240) - Fix
/q
parameter not added when usingcmd
instead ofcmd.exe
(#203) - Fix uncaught exception when using
input
option with a non-executable file (#212, #258) - Fix errors on child processes waiting for stdout/stderr to complete (#270)
- Fix validating that the
stdio
option cannot be used together withstdin: 0
(#301).
Documentation
Design
- Add a logo (#201)
Tests
Maintainers
- Add @ehmicky as an additional maintainer.