# resource-on-exit

> Register sync teardown handlers for a resource

Latest version **1.0.0** (published 2025-11-08) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install resource-on-exit
pnpm add resource-on-exit
yarn add resource-on-exit
bun add resource-on-exit
```

## Health

**Score 45/100 (D)** — status: stable.

Positive: no vulnerabilities.

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

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2025-11-08 |
| First published | 2025-11-08 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 12.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Holepunch Inc. |
| Maintainers | mafintosh |

## Links

- npm: https://www.npmjs.com/package/resource-on-exit
- Repository: https://github.com/holepunchto/bare-teardown
- Issues: https://github.com/holepunchto/bare-teardown/issues
- npm.io page: https://npm.io/package/resource-on-exit

## Recent versions

- 1.0.0 (latest) — 2025-11-08

## README

# resource-on-exit

Register sync teardown handlers for a resource

```
npm install resource-on-exit
```

## Usage

``` js
const { add, remove } = require('resource-on-exit')

const file = { fd }

add(file, () => fs.closeSync(file.fd))
remove(file) // to remove
```

## License

Apache-2.0

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