This is my code:
process.on('SIGTERM', () => {
console.log('Got SIGTERM signal.')
})
process.kill(process.pid, 'SIGTERM')
Node: v20.16.0
OS: Windows 10
I executed the file by running node test.js
. I expected to see Got SIGTERM signal
logged to my console. However, there is nothing logged to my console. Can someone explain what I’m misunderstanding?