{"library":"simple-redis-mutex","type":"library","category":null,"description":"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.","language":"javascript","status":"active","version":"3.0.0","tags":["javascript","redis","mutex","lock","expire","typescript"],"last_verified":"Sun Jun 07","install":[{"cmd":"npm install simple-redis-mutex","imports":["import { lock } from 'simple-redis-mutex'","import { tryLock } from 'simple-redis-mutex'","import type { LockOptions } from 'simple-redis-mutex'"]},{"cmd":"yarn add simple-redis-mutex","imports":[]},{"cmd":"pnpm add simple-redis-mutex","imports":[]}],"homepage":"https://github.com/AmrSaber/simple-redis-mutex#readme","github":"https://github.com/AmrSaber/simple-redis-mutex","docs":null,"changelog":null,"pypi":null,"npm":"simple-redis-mutex","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":null}