signal.js 234 Bytes Edit Raw Blame History 1 2 3 4 5 6 7 8 9 10 11 12 13 ['SIGINT', 'SIGTERM'].forEach(function(signal) { process.on(signal, function() { console.log(signal); process.exit(1); }); }); function doNothing() { setTimeout(doNothing, 1000); } doNothing(); console.log('STARTED');