I want to know if it is possible to detect when the node.js process is closed by clicking the "X" button in Windows. If so, how. I tried process.on("exit");, but it did not work.
process.on("exit");
Catch high
/* * Run this code and close the Window before the 10 seconds */ var x = setTimeout(function() { console.log('hello world') }, 10000); process.on('SIGHUP', function() { console.log('About to exit'); process.exit(); });