# fd-lock

> Stateful file descriptor locks for JavaScript

Latest version **2.2.0** (published 2026-06-17) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install fd-lock
pnpm add fd-lock
yarn add fd-lock
bun add fd-lock
```

## Health

**Score 65/100 (B)** — status: active.

Positive: esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 2.2.0 |
| Published | 2026-06-17 |
| First published | 2019-01-23 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 14.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 1 |
| Author | Holepunch |
| Maintainers | mafintosh |

## Links

- npm: https://www.npmjs.com/package/fd-lock
- Repository: https://github.com/holepunchto/fd-lock
- Homepage: https://github.com/holepunchto/fd-lock#readme
- Issues: https://github.com/holepunchto/fd-lock/issues
- npm.io page: https://npm.io/package/fd-lock

## Dependencies (4)

- [bare-fs](https://npm.io/package/bare-fs.md) ^4.5.0
- [ready-resource](https://npm.io/package/ready-resource.md) ^1.2.0
- [resource-on-exit](https://npm.io/package/resource-on-exit.md) ^1.0.0
- [fs-native-extensions](https://npm.io/package/fs-native-extensions.md) ^1.4.4

## Recent versions

- 2.2.0 (latest) — 2026-06-17
- 2.1.1 — 2025-11-10
- 2.1.0 — 2025-11-10
- 2.0.0 — 2025-11-10
- 1.2.0 — 2021-01-28
- 1.1.2 — 2021-01-27
- 1.1.1 — 2020-07-02
- 1.1.0 — 2020-06-25
- 1.0.2 — 2019-01-24
- 1.0.1 — 2019-01-24
- 1.0.0 — 2019-01-24
- 0.0.2 — 2019-01-24
- 0.0.1 — 2019-01-23
- 0.0.0 — 2019-01-23

## README

# fd-lock

Stateful file descriptor locks for JavaScript.

```
npm i fd-lock
```

## Usage

```js
const FDLock = require('fd-lock')

const lock = new FDLock(fd, { wait: true })
await lock.ready()

// Lock is now held

await lock.close()
```

## License

Apache-2.0

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