# cleankill

> Hook SIGINT and cleanly shut down your async code

Latest version **2.0.0** (published 2016-06-30) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install cleankill
pnpm add cleankill
yarn add cleankill
bun add cleankill
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2016-06-30 |
| First published | 2015-01-16 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | azakus, garlicnation, justinfagnani, nevir, polymer, rictic |

## Links

- npm: https://www.npmjs.com/package/cleankill
- Repository: https://github.com/PolymerLabs/cleankill
- Issues: https://github.com/PolymerLabs/cleankill/issues
- npm.io page: https://npm.io/package/cleankill

## Recent versions

- 2.0.0 (latest) — 2016-06-30
- 1.0.3 — 2016-06-28
- 1.0.2 — 2015-04-08
- 1.0.1 — 2015-04-02
- 1.0.0 — 2015-01-16

## README

# 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

```js
var cleankill = require('cleankill');
```

To register a handler:

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

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

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

---
_Source: https://npm.io/package/cleankill · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
