listen to ctrl c node js code example
Example: node js on ctrl c
process.on('SIGINT', function() {
console.log("Caught interrupt signal");
if (i_should_exit)
process.exit();
});
process.on('SIGINT', function() {
console.log("Caught interrupt signal");
if (i_should_exit)
process.exit();
});