cleankill
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

Cleankill

CleanKill hooks the interrupt handler, and provides callbacks for your code to cleanly shut down before the process exits.

As an escape hatch, if the user mashes interrupt, the process will be immediately killed.

Using It

var cleankill = require('cleankill');

To register a handler:

cleankill.onInterrupt(() => {
  return new Promise((resolve) => {
    // do things.
    resolve();
  });
});

If you wish to shut down any existing handlers (without exiting the process):

cleankill.close().then(() => {
  // All handlers have cleaned things up.
});

Readme

Keywords

none

Package Sidebar

Install

npm i cleankill

Weekly Downloads

3,461

Version

2.0.0

License

BSD-3-Clause

Last publish

Collaborators

  • aomarks
  • emarquez
  • sorvell
  • bicknellr
  • usergenic
  • polymer-devs
  • azakus
  • kevinpschaaf
  • justinfagnani
  • rictic
  • nevir
  • garlicnation