# at-exit-hook

> register js function which can be called before process exit

Latest version **1.0.1** (published 2017-02-27) · ISC license · 0 weekly downloads

## Install

```sh
npm install at-exit-hook
pnpm add at-exit-hook
yarn add at-exit-hook
bun add at-exit-hook
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2017-02-27 |
| First published | 2017-02-27 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 0 |
| Author | hyj1991 |
| Maintainers | hyj1991 |
| Keywords | at, exit, atExit |

## Links

- npm: https://www.npmjs.com/package/at-exit-hook
- Repository: https://github.com/hyj1991/at-exit
- Homepage: https://github.com/hyj1991/at-exit#readme
- Issues: https://github.com/hyj1991/at-exit/issues
- npm.io page: https://npm.io/package/at-exit-hook

## Dependencies (1)

- [nan](https://npm.io/package/nan.md) ^2.5.1

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads
- [tg-resolve](https://npm.io/package/tg-resolve.md) — 176 weekly downloads

## Recent versions

- 1.0.1 (latest) — 2017-02-27
- 1.0.0 — 2017-02-27

## README

# at-exit-hook

##Install
npm install at-exit-hook

##Instruction
This is a package which you can register some js function, that can be called before the node process exit.

##Usage
```js
const atExit = require('at-exit-hook');

//register single function
atExit(function before(){
	console.log('I will be called before process exit!');
});

//register function arrays also supported
atExit([function callback1(){
	console.log('I will be called 1');
}, function callback2(){
	console.log('I will be called 2');
}])
```

Attention：You can at most set 5 functions that can be called before process exit!


##安装
npm install at-exit-hook

##说明简介
用来注册回调函数，这些回调函数会在你的Node进程推出前被执行，相当于给Node进程设置了一个退出前的钩子。

##如何使用
```js
const atExit = require('at-exit-hook');

//注册单独的一个回调函数
atExit(function before(){
	console.log('I will be called before process exit!');
});

//注册回调函数组成的数组同样是支持的
atExit([function callback1(){
	console.log('I will be called 1');
}, function callback2(){
	console.log('I will be called 2');
}])
```
注意：你最多可以设置5个推出前执行的回调函数！

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