# DirtyHairy/async-mutex

A mutex for synchronizing async workflows in Javascript

Repository: https://github.com/DirtyHairy/async-mutex
Canonical: https://ross.abutalabs.com/products/async-mutex
Language: TypeScript
License: MIT
License Family: permissive
Last push: 2025-07-19T08:27:14+00:00

## Health v2 (maintenance only)
Score: 47/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 32, release rhythm 35, longevity 100
- inputs: {"age_days": 3612, "days_push": 410, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1430, forks 70 (observed 2026-08-28T04:04:42.381504+00:00)

## What it is
A TypeScript library providing mutex and semaphore primitives for synchronizing asynchronous JavaScript workflows. Locking returns a promise that resolves when the resource becomes available, preventing race conditions in single-threaded async code.

## Use cases
- serialize access to a shared async resource in JavaScript
- limit concurrent requests in a web crawler
- prevent race conditions when exchanging messages with a web worker
- control parallelism of async tasks with a semaphore
- guard async workflows against reentrant calls

## When to choose
- you need promise-based locking for async/await code
- you want to cap the number of concurrent async operations
- you need a tiny, dependency-free synchronization primitive in Node or the browser

## When to avoid
- you need true multi-threaded synchronization (use worker threads with Atomics)
- your code is fully synchronous and single-threaded without interleaving
- you need distributed locking across processes or machines

## Facets
- artifact type: library
- maturity: stable
- function: concurrency, developer-tools
- domain: developer-tools, web-development
- platform: browser, cross-platform
- tags: mutex, semaphore, async, typescript, synchronization, promise-based, javascript, nodejs

## Member repositories
- DirtyHairy/async-mutex (main) score 47

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:42.381504+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:37:10.134208+00:00, confidence not recorded.
  - readme: https://github.com/DirtyHairy/async-mutex (fetched 2026-08-28T04:04:42.381504+00:00, sha dc1b82c31732)
  - registry_npm: https://registry.npmjs.org/async-mutex (fetched 2026-08-29T11:48:48.145034+00:00, sha 3864bbb6d897)
- Data as of 2026-08-30T08:39:29.467469+00:00.
