# co-lock

> Lock resources asyncrounously

Latest version **0.0.1** (published 2014-05-19) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2014-05-19 |
| First published | 2014-05-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Bence Dányi |
| Maintainers | lennon |
| Keywords | lock, mutex, co |

## Links

- npm: https://www.npmjs.com/package/co-lock
- Repository: https://github.com/madbence/co-lock
- Issues: https://github.com/madbence/co-lock/issues
- npm.io page: https://npm.io/package/co-lock

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2014-05-19
- 0.0.0 — 2014-05-19

## README

# co-lock

Asyncronous resources, generator style. Finally, Javascript has deadlocks!

## Install

```
$ npm install co-lock
```

## Usage

```js
var release = yield lock(target);
// critical section
yield release;
```

## API

#### lock(target[, timeout])

Creates a lock on `target`, yields with `release` when the lock can be acquired.
If cannot acquire lock within `timeout`, throws error.

## License

MIT

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