modern-spawn
A set of spawn and exec functions that match the API you need 90% of the time in modern applications.
Installation
yarn add modern-spawn
Usage
; ; console.loghello;
API
; ; ; ;
getResult
can be used to requeststdout
as either a Buffer or string and automatically throw an error with plenty of context if the process exited with a non-zero status code.- set
debug
totrue
if you want to pipe log stdout & stderr to the parent process for debugging, in addition to buffering it. execBufferedSync
does returns an empty Buffer forstderr
unless the process exits with a non-zero exit code. This is due to a limitation of the node.js API.