Small Utility To Observe NodeJS Child Processes life cycle events using notifications.
npm i cpcycle
const childProcess = require("child_process");
const cpcycle = require("cpcycle")(/*Options*/);
let shell = cpcycle(childProcess.spawn, /*Optional Name*/);
shell("echo", ["it works"])
.stdout.on("data", (data)=> {
console.log(data.toString())
})
Initialize Cycple
Options
trace
: true/false - Turn on/off tracingevents
: ["Close", "Stdout"] - Events to track
Wrap a child process method and pass an optional name to identify it via notification
MIT