Yet another spawn promise. (Zero dependency!)
- Promisified child_process.spawn, with more options
- stdout/stderr to console by default.
- Route stdout or stderr to file.
- Can run spawn as detached (promise will return with handle)
- Typescript definitions
Notes:
- Require node.js > 8.0 (if you need more support, log ticket)
- Warning: From 0.4.0 needs to be imported as
{ spawn }
// or `const {spawn } from 'p-spawn' await ; // return Promise
Examples:
const spawn = ; { // will console log the stdout and stderr await ; // will not console log the stdout but rather to forward in onStdout var txt = ; await ; console; // we an pass spawn options as well await ; // we an pass spawn options as well var result = await ; console; // "hello world" }