1.0.0 β€’ Published 8 years ago

curtain-down v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

curtain-down

Register functions to run when node exits with npm install curtain-down.

const curtain = require('curtain-down');

const applaud = console.log.bind(console, 'πŸ‘ πŸ‘ πŸ‘');
const boo = console.log.bind(console, 'πŸ… πŸ… πŸ…');

// Register functions to run when SIGTERM or SIGKILL are received:
curtain.on(applaud);  // every time;
curtain.once(boo);    // just once.

// You can also cancel…
curtain.off(boo);  // a particular function,
curtain.off();     // or all of them.