Run some code when the process exits
process.on('exit') event doesn't catch all the ways a process can exit.
Useful for cleaning up.
$ npm install --save exit-hook
var exitHook = ;;// you can add multiple hooks, even across files;throw 'unicorns';//=> exiting//=> exiting 2
MIT © Sindre Sorhus