# guarantor

> Guarantees things will happen, even if we are interrupted

Latest version **0.11.0** (published 2015-11-30) · ISC license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.11.0 |
| Published | 2015-11-30 |
| First published | 2015-11-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | erikpukinskis |

## Links

- npm: https://www.npmjs.com/package/guarantor
- Repository: https://github.com/erikpukinskis/guarantor
- Homepage: https://github.com/erikpukinskis/guarantor#readme
- Issues: https://github.com/erikpukinskis/guarantor/issues
- npm.io page: https://npm.io/package/guarantor

## Recent versions

- 0.11.0 (latest) — 2015-11-30
- 0.10.0 — 2015-11-18
- 0.9.0 — 2015-11-16
- 0.8.0 — 2015-11-16
- 0.7.0 — 2015-11-16
- 0.6.0 — 2015-11-16
- 0.5.0 — 2015-11-16
- 0.4.0 — 2015-11-13
- 0.3.0 — 2015-11-13
- 0.2.0 — 2015-11-12
- 0.1.0 — 2015-11-12

## README

Guarantees things will happen, even if an error is thrown or the process is killed:

~~~javascript
var guarantor = require("guarantor")

guarantor(function(callback, status) {

  yourCleanupFunction(callback)

  if (status == 0) {
    console.log("Log an error here if you were hoping to do something asynchronously. Node is exiting.")
  }
}
~~~

Test the three code paths:

Run `npm test` and wait for an error to be thrown.

Run `npm test` and hit ctrl+c.

Run `npm test normal exit` to see the warning we throw when we don't have time to wait for the callbacks.

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