1.0.0 β’ Published 8 years ago
curtain-down v1.0.0
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.
1.0.0
8 years ago