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

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));