1
0
Fork 0
arangodb/js/node/node_modules/exit-hook
Andreas Streichardt 8a286a30d9 We are now using semistandard and eslint 2016-06-29 18:27:02 +02:00
..
index.js We are now using semistandard and eslint 2016-06-29 18:27:02 +02:00
package.json We are now using semistandard and eslint 2016-06-29 18:27:02 +02:00
readme.md We are now using semistandard and eslint 2016-06-29 18:27:02 +02:00

readme.md

exit-hook Build Status

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