# promaphore

> Promise Semaphore

Latest version **1.0.0** (published 2022-01-21) · MIT license · 0 weekly downloads

## Install

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

## 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.0 |
| Published | 2022-01-21 |
| First published | 2022-01-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 26 |
| Author | Mathias Buus |
| Maintainers | mafintosh |

## Links

- npm: https://www.npmjs.com/package/promaphore
- Repository: https://github.com/mafintosh/promaphore
- Issues: https://github.com/mafintosh/promaphore/issues
- npm.io page: https://npm.io/package/promaphore

## Recent versions

- 1.0.0 (latest) — 2022-01-21
- 0.0.0 — 2022-01-21

## README

# promaphore

Promise Semaphore

```
npm install promaphore
```

## Usage

``` js
const Semaphore = require('promaphore')

const s = new Semaphore(2) // 2 is the max operation count

if (await s.wait()) { // wait for the to enter the block (only 2 can be in here at once)
  s.signal() // signal that you are exiting the block
}
```

If you want to await all pending operations do `await s.flush()`
If you want to signal all pending waits do `s.destroy()`

## License

MIT

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