</>PackageGraphPackageGraph

await-lock

npmv3.0.0

Mutex 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.

0
Direct dependencies

Runtime packages this one declares itself.

0
Total installed

Distinct packages in the full runtime tree, deduplicated the way a package manager would.

13 KB
Install size

Unpacked size of this package plus its entire runtime tree.

Tree depth

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.

javascriptFull 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.

PackageWeekly downloadsDependentsLicenseLast release
await-lockthis page01MIT1 year ago
p-limit293.1M5MIT1 day ago
p-locate216.9M1MIT1 day ago
cross-fetch32.9M2MIT1 day ago
p-map01MIT1 day ago
co31.2M4MIT1 day ago

Dependencies

Declared by await-lock v3.0.0. Runtime dependencies are installed with the package; dev dependencies are not.

Used by

Popular packages that depend on await-lock.

Relationship graph

Dependencies (left) and dependents (right) of await-lock.

expo-sqliteawait-lock
await-lock dependencies dependents

Frequently installed together

Release history

1 release in the last two years, typically about 52 days apart.

Recent versions of await-lock
VersionPublishedSizeLicense
3.0.0latest1 year ago13 KBMIT
2.2.24 years ago14 KBMIT
2.2.14 years ago11 KBMIT
2.2.04 years ago18 KBMIT
2.1.06 years ago12 KBMIT
2.0.16 years ago11 KBMIT
2.0.07 years ago11 KBMIT
1.2.17 years ago10 KBMIT
1.2.07 years ago11 KBMIT
1.1.38 years ago5.9 KBMIT
1.1.29 years agoMIT
1.1.111 years agoMIT
1.1.011 years agoMIT
1.0.011 years agoMIT
0.0.111 years agoMIT

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

Keywords

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.