web-locks

JSON →
library 0.0.9 ·javascript
verified Jun 4, 2026

Node.js implementation of the Web Locks API that provides mutex and semaphore primitives for coordinating access to shared resources across worker threads. v0.0.9 (stable) uses worker_threads, Atomics, and SharedArrayBuffer for multi-threaded locking, with a fallback to single-threaded async locks. Supports a single unified API for both single-threaded and multi-threaded environments. Part of the Metarhia stack, targeting eventual inclusion in Node.js core. Minimal dependencies, MIT licensed.