git-svn-id: https://svn.libreccm.org/ccm/trunk@5740 8810af33-2d31-482b-a856-94f89814c4df |
||
|---|---|---|
| .. | ||
| index.js | ||
| package.json | ||
| readme.md | ||
readme.md
exit-hook 
Run some code when the process exits
The process.on('exit') event doesn't catch all the ways a process can exit.
Useful for cleaning up.
Install
$ npm install --save exit-hook
Usage
var exitHook = require('exit-hook');
exitHook(function () {
console.log('exiting');
});
// you can add multiple hooks, even across files
exitHook(function () {
console.log('exiting 2');
});
throw new Error('unicorns');
//=> exiting
//=> exiting 2
License
MIT © Sindre Sorhus