A spawned child is terminated with child.kill('SIGTERM'). What do code and signal contain in the 'close' (or 'exit') event?
const c = spawn('node', ['-e', 'setTimeout(()=>{}, 10000)']);
setTimeout(() => c.kill('SIGTERM'), 100);
c.on('close', (code, signal) => console.log(code, signal));