0

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?

aser33
  • 1
  • 1
    Does the following help? https://stackoverflow.com/questions/64390685/why-sigterm-event-handler-wasnt-called-in-my-code-example – qrsngky Feb 23 '23 at 09:21

0 Answers0