Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumNodeJSchild_process spawningSingle-choice MCQ

A long-running child is killed with child.kill('SIGTERM'). Inside the parent's exit handler (code, signal) => {...}, what are code and signal?

const c = spawn('node', ['-e', 'setInterval(()=>{},1000)']); c.on('exit', (code, signal) => console.log(code, signal)); setTimeout(() => c.kill('SIGTERM'), 50);