node-redis-warlock is a distributed locking library for Node.js using Redis, version 1.0.2. It provides battle-hardened locking mechanisms such as simple lock, optimistic lock with retries, unlocking by lock ID, and TTL modification. It requires node-redis (v0.10 compatible) and Redis v2.6.12+. The library is synchronous in style, relying on callbacks rather than promises or async/await, which is a key differentiator from modern Redis locking libraries like redlock that support promises. Release cadence is sporadic; no recent updates.
npm install node-redis-warlockNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Connects to Redis, creates a warlock instance, acquires a lock, does work, then releases the lock.
Check typeof unlock === 'function' before calling it.
Always pass the lock ID to warlock.unlock().
Use the 'redis' package (not 'ioredis') to create the client.
Use 'redis' v2.8 or later, but ensure compatibility with callback style.
Always check if unlock is a function before calling it.
Use const Warlock = require('node-redis-warlock'); then const warlock = Warlock(redis);Check typeof unlock === 'function' before calling unlock().
Install and use 'redis' npm package (npm install redis).