Socket
Socket
Sign inDemoInstall

cleankill

Package Overview
Dependencies
0
Maintainers
6
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cleankill

Hook SIGINT and cleanly shut down your async code


Version published
Weekly downloads
3.4K
decreased by-5.79%
Maintainers
6
Install size
12.9 kB
Created
Weekly downloads
 

Readme

Source

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.
});

FAQs

Last updated on 30 Jun 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc