- Promises instead of callbacks
- Execution of locally installed binaries
- Better cross-platform support, including shebangs
- Cleanup of child processes when their parent exits
- And more
Thanks to Sindre Sorhus, ehmicky, GMartigny, BendingBender, tomsotte, Malik Ammar Faisal, zokker13, stroncium, Satya Rohith, Brad Lemley, coreyfarrell, Brandon Smith, Thai Pangsakulyanont and Pedro Augusto de Paula Barbosa, the following features are now available:
- TypeScript support
- Interleaved stdout and stderr
- Shell mode updates
- Changes to local binaries execution
- Improved spawning of Node.js scripts
- Graceful exit
- Process cancellation
- Enhanced errors
- Stricter exit codes
- Gulp plugin
- And more updates and bug fixes
We have added TypeScript declarations.
While it has (very) few legitimate uses, the
shell option should be avoided.
Why? First, it encourages shell-specific syntax (Bash,
cmd.exe) which won’t work on every OS. Almost every shell feature is available directly in Node.js.
Second, it is much slower as it makes every command go through the shell interpreter.
Last but not least, it increases the risk of command injection:
As a consequence, we have removed
execa.shellSync() which were merely shortcuts to the
execa.commandSync() can now be used to specify the command and its arguments as a single string without the
shell option. Nothing needs to be escaped/quoted except for significant spaces (with a backslash).
preferLocal option now defaults to
false. If you are executing locally installed binaries, you’ll need to specify the
preferLocal: true option.
Some processes handle the
SIGTERM signal in order to cleanup resources and exit gracefully. This might take a long time or even never finish.
childProcess.kill() now sends a
SIGKILL signal after 5 seconds to prevent this. This can be configured using the
We have improved error messages and properties. Node.js child process errors contain less information, scattered over several events:
Execa produces better errors:
Execute commands in Gulp.js with Gulp Execa. This thin wrapper around Execa adds Gulp-specific features related to verbosity, output, errors and streaming.
Node.js 6 support has been dropped.
windowsHide option is now always
true. This ensures that no window pops up on Windows.
maxBuffer option default value has been increased from
10 MB to
Several bugs have also been fixed.
For more information, check the full changelog.