node v8.9.1, , app.js.
: node_trace.1.log
, node (node --trace-events-enabled ./bin/trace-me.js
./
):
console.log("Trace me");
const interv = setInterval(()=>console.log("Runnning"), 1000);
process.on('SIGINT', function onSigint() {
console.info('Got SIGINT (aka ctrl-c). Graceful shutdown ', new Date().toISOString());
clearInterval(interv);
});
process.on('beforeExit', function (exitCode) {
console.log("Before exit: "+ exitCode);
});
ctrl-c
, , beforeExit
.
, process.exit()
:
, , , - process.stdout process.stderr. .
, SIGINT
SIGTERM
, beforeExit
, , Node.js .