The following code works on Mac but not on windows and I am trying to understand why (running Node 16.13.1 on both)
console.log('started');
process.on('exit', () => {
console.log('exit')
})
process.on('SIGTERM', () => {
console.log('SIGTERM')
})
setTimeout(() => {
process.kill(process.pid)
}, 2000)
on windows it logs
started
on Mac it logs
started
SIGTERM
exit
What am I missing here?