# bmutex

> Mutex locks for javascript

Latest version **0.1.8** (published 2025-01-17) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 25/100 (F)** — status: maintenance-mode.

Positive: no vulnerabilities.

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

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.8 |
| Published | 2025-01-17 |
| First published | 2017-11-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.0.0 |
| Dependencies | 1 |
| Unpacked size | 11.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Christopher Jeffrey |
| Maintainers | chjj, nodweber, pinheadmz |
| Keywords | lock, mutex |

## Links

- npm: https://www.npmjs.com/package/bmutex
- Repository: https://github.com/bcoin-org/bmutex
- Issues: https://github.com/bcoin-org/bmutex/issues
- npm.io page: https://npm.io/package/bmutex

## Dependencies (1)

- [bsert](https://npm.io/package/bsert.md) ~0.0.13

## Alternatives

- [@oh-my-pi/pi-natives](https://npm.io/package/@oh-my-pi/pi-natives.md) — 51.8K weekly downloads
- [@capgo/capacitor-light-sensor](https://npm.io/package/@capgo/capacitor-light-sensor.md) — 3.0K weekly downloads
- [@heyhuynhgiabuu/pi-diff](https://npm.io/package/@heyhuynhgiabuu/pi-diff.md) — 492 weekly downloads
- [@lotsa/verdant-lang-asm](https://npm.io/package/@lotsa/verdant-lang-asm.md) — 38 weekly downloads
- [new-era-syntax](https://npm.io/package/new-era-syntax.md) — 20 weekly downloads

## Recent versions

- 0.1.8 (latest) — 2025-01-17
- 0.1.7 — 2023-08-31
- 0.1.6 — 2019-03-21
- 0.1.5 — 2019-01-22
- 0.1.4 — 2018-11-29
- 0.1.3 — 2018-09-29
- 0.1.2 — 2018-07-19
- 0.1.1 — 2018-07-14
- 0.1.0 — 2018-06-08
- 0.0.2 — 2018-03-12
- 0.0.1 — 2017-12-29
- 0.0.0 — 2017-11-02

## README

# bmutex

Mutex locks for javascript.

## Usage

``` js
const {Lock} = require('bmutex');
const lock = Lock.create();

async function doSomething() {
  const unlock = await lock();
  try {
    await _doSomething();
  } finally {
    unlock();
  }
}

async function _doSomething() {
  // actually do something async
}
```

## Contribution and License Agreement

If you contribute code to this project, you are implicitly allowing your code
to be distributed under the MIT license. You are also implicitly verifying that
all code is your original work. `</legalese>`

## License

- Copyright (c) 2017, Christopher Jeffrey (MIT License).

See LICENSE for more info.

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