await-lock
npmv3.0.0Mutex locks for async functions
Adopt with care
await-lock is usable, with caveats. Last published 563 days ago.
- ?Adoption: grade ?, Not reported by this registry.
No download data reported for this package yet.
- CMaintenance: grade C, Fair — worth a look.
Last published 563 days ago.
- AWeight: grade A, Excellent.
Zero runtime dependencies, about 13 KB installed.
- BSupply chain: grade B, Good.
This package has a single maintainer (bus factor of 1).
- ALicense: grade A, Excellent.
MIT — permissive, with no copyleft found in the dependency tree.
Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.
Install cost
What you actually take on by adding await-lock to a project.
Runtime packages this one declares itself.
Distinct packages in the full runtime tree, deduplicated the way a package manager would.
Unpacked size of this package plus its entire runtime tree.
Longest resolved dependency chain below this package.
Compatibility
- Node.js
- No constraint declared
- Module format
- ESM only
- TypeScript
- No bundled types
- Install scripts
- None
Quick start
A usage example from the await-lock README.
import AwaitLock from 'await-lock';
let lock = new AwaitLock();
async function runSerialTaskAsync() {
await lock.acquireAsync();
try {
// IMPORTANT: Do not return a promise from here because the finally clause
// may run before the promise settles, and the catch clause will not run if
// the promise is rejected
} finally {
lock.release();
}
}await-lock vs the alternatives
Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.
| Package | Weekly downloads | Dependents | License | Last release |
|---|---|---|---|---|
| await-lockthis page | 0 | 1 | MIT | 1 year ago |
| p-limit | 293.1M | 5 | MIT | 1 day ago |
| p-locate | 216.9M | 1 | MIT | 1 day ago |
| cross-fetch | 32.9M | 2 | MIT | 1 day ago |
| p-map | 0 | 1 | MIT | 1 day ago |
| co | 31.2M | 4 | MIT | 1 day ago |
Dependencies
Declared by await-lock v3.0.0. Runtime dependencies are installed with the package; dev dependencies are not.
Dev (9)
Used by
Popular packages that depend on await-lock.
Relationship graph
Dependencies (left) and dependents (right) of await-lock.
Frequently installed together
The Expo SDK
React is a JavaScript library for building user interfaces.
TypeScript definitions for better-sqlite3
The fastest and simplest library for SQLite in Node.js.
TypeScript definitions for react
A framework for building native apps using React
Simple and complete React Native testing utilities that encourage good testing practices.
TypeScript definitions for node
Release history
1 release in the last two years, typically about 52 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 3.0.0latest | 1 year ago | 13 KB | MIT |
| 2.2.2 | 4 years ago | 14 KB | MIT |
| 2.2.1 | 4 years ago | 11 KB | MIT |
| 2.2.0 | 4 years ago | 18 KB | MIT |
| 2.1.0 | 6 years ago | 12 KB | MIT |
| 2.0.1 | 6 years ago | 11 KB | MIT |
| 2.0.0 | 7 years ago | 11 KB | MIT |
| 1.2.1 | 7 years ago | 10 KB | MIT |
| 1.2.0 | 7 years ago | 11 KB | MIT |
| 1.1.3 | 8 years ago | 5.9 KB | MIT |
| 1.1.2 | 9 years ago | — | MIT |
| 1.1.1 | 11 years ago | — | MIT |
| 1.1.0 | 11 years ago | — | MIT |
| 1.0.0 | 11 years ago | — | MIT |
| 0.0.1 | 11 years ago | — | MIT |
Overview
await-lock is an npm package that mutex locks for async functions. It has 1 known dependents in the graph. The latest version is 3.0.0, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need mutex locks for async functions and value a focused solution.
When not to use it
Consider an alternative if you need to have first-class TypeScript types out of the box, or if a more actively-maintained option better fits your npm stack.
Pros
- Clear open-source license (MIT).
Cons
- No bundled TypeScript types (may require a separate @types package).
Auto-generated from collected registry metadata. No external claims are inferred.
Maintainers
Frequently asked questions
Should I use await-lock?
await-lock is usable, with caveats. Last published 563 days ago.
How do I install await-lock?
Run `npm install await-lock` to add await-lock to your npm project.
What license is await-lock released under?
await-lock is distributed under the MIT license.
How popular is await-lock?
npm does not publish download counts. Within PackageGraph's crawl, 1 known packages depend on await-lock.
Is await-lock still maintained?
The most recent release of await-lock (v3.0.0) was published 1 year ago.
Does await-lock run install scripts?
No. await-lock does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.