Pulse7
9/9/2017 - 6:33 PM

On exit, uncaughtException

process.on("exit",code=>{
  //do one final synchronous operation
  //before termination
});

process.on("uncaughtException",err=>{
  //unhandled err
  process.exit(1);
});

process.stdin.resume();