simple-redis-mutex
JSON →simple-redis-mutex is a lightweight distributed mutex lock implementation using Redis, based on the SETNX + EXPIRE pattern described in Redis docs. Version 3.0.0 ships TypeScript types, supports ESM and CJS, and relies on Redis >=5.0.0 as a peer dependency. Unlike the more complex Redlock algorithm, this library focuses on simplicity and uses Redis Pub/Sub for immediate lock release notification, with manual polling as a fallback. It offers two lock acquisition methods: blocking `lock` and non-blocking `tryLock`, both returning a release function with an optional fencing token. The package is actively maintained and suitable for Node.js >=8.2.1.
Resources
packagesimple-redis-mutex ↗
API endpoints
full doc /v1/registry/simple-redis-mutex