Package Exports
- when-exit
- when-exit/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (when-exit) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
When Exit
Execute a function right before the process is about to exit.
Install
npm install --save when-exit
Usage
import whenExit from 'when-exit';
onExit ( () => {
console.log ( 'Callback 1' );
});
onExit ( () => {
console.log ( 'Callback 2' );
});
const disposer = onExit ( () => {
console.log ( 'Callback 3' );
});
disposer ();
process.exit (); // Callback 1 and 2 are called before exiting
License
MIT © Fabio Spampinato