# adv-lock

> Lock Manager

Latest version **1.0.1** (published 2022-06-26) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2022-06-26 |
| First published | 2022-06-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Fabeuluci |
| Maintainers | fabeuluci |

## Links

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

## Dependencies (1)

- [adv-promise](https://npm.io/package/adv-promise.md) ^1.0.0

## Recent versions

- 1.0.1 (latest) — 2022-06-26

## README

# Adv-Lock
Lock Manager. Execute only one async call in the same time.

## Usage
```
import { LockManager } from "adv-lock";

const lockManager = LockManager.create();

// do_foo executes first and after do_foo finish do_bar start executing
lockManager.withLock("my-lock-id", () => do_foo());
lockManager.withLock("my-lock-id", () => do_bar());

// you can lock multi ids in the same time
lockManager.withLock(["my-lock-id", "foo", "bar"], () => do_something());
```

# License
MIT

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