A production-ready distributed locking library for Redis and Valkey supporting all three major clients: node-redis, ioredis, and Valkey GLIDE. Version 0.8.4, stable and actively maintained. It uses the Redlock algorithm for fault-tolerant locks with automatic lock extension and cleanup. Key differentiator: universal client support while maintaining sub-millisecond performance (0.377ms latency, comparable to dedicated libraries). Includes TypeScript types, monitoring hooks, and optional LockManager for multi-node setups.
npm install redlock-universalNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to acquire and automatically manage a distributed lock using ioredis with auto-extension.
Use import syntax or dynamic import().
Upgrade Node.js to 22.0.0 or later.
Replace 'monitor' with 'monitoring' in configuration.
Use createLock for a single Redis/Valkey instance.
Pass new Redis() or RedisCluster instance.
Switch to import syntax or use dynamic import() in CJS context.
Ensure adapter is correctly imported and instantiated: new IoredisAdapter(new Redis())
Pass an array of adapters: new LockManager({ nodes: [adapter], defaultTTL: 30000 })Check that key and adapter are provided and valid.