node-tree-kill
node-tree-kill copied to clipboard
No error given when kill fails
Given the following program:
process.on('SIGTERM', () => console.error('Ignoring'));
let n = 0;
setInterval(()=> console.log(n++), 2*1000);
I have tried to kill it using treeKill via something like
treeKill(myPID, (err) => {console.log(typeof err)})
Here I get no err because, like kill on linux, the exit code is 0 as the signal was sent successfully. Is this expected? I assume so, but it makes ensuring a process is dead a little more complex.