@alwatr/exit-hook
Version:
A utility for registering exit handlers in Node.js.
30 lines (18 loc) • 637 B
Markdown
# Exit Hook
A utility for registering exit handlers in Node.js.
## Installation
```bash
yarn add @alwatr/exit-hook
```
## Usage
```typescript
import {exitHook} from '@alwatr/exit-hook';
const saveAllData = () => {
// save all data
};
exitHook(saveAllData);
```
## Sponsors
The following companies, organizations, and individuals support Nanolib ongoing maintenance and development. Become a Sponsor to get your logo on our README and website.
### Contributing
Contributions are welcome! Please read our [contribution guidelines](https://github.com/Alwatr/.github/blob/next/CONTRIBUTING.md) before submitting a pull request.