
Production-ready Redis utilities and libraries for Node.js applications
Distributed locking • High performance • Type-safe • Battle-tested
RedisKit is a collection of production-ready Redis utilities designed for modern Node.js applications. Built with TypeScript and focused on reliability, performance, and developer experience.
Distributed locking library implementing the Redlock algorithm with automatic lifecycle management.
npm install @redis-kit/lock
Key Features:
- Fault-tolerant distributed locking across multiple Redis instances
- Automatic lock extension for long-running operations
- Full TypeScript support with comprehensive type definitions
- Production-tested with clock drift compensation and retry logic
import { Redlock } from '@redis-kit/lock';
import { createClient } from 'redis';
// Set up Redis clients
const clients = [
createClient({ host: 'redis1.example.com' }),
createClient({ host: 'redis2.example.com' }),
createClient({ host: 'redis3.example.com' }),
];
await Promise.all(clients.map((client) => client.connect()));
// Create distributed lock
const redlock = new Redlock(clients);
// Use the lock
await redlock.withLock('critical-resource', 30000, async () => {
// Your critical section here
await performCriticalOperation();
});
This project uses Nx for monorepo management and build orchestration.
- Node.js 18+
- pnpm (recommended package manager)
RedisKit follows these principles:
- Type Safety: Full TypeScript support with strict typing
- Production Ready: Battle-tested with comprehensive error handling
- Developer Experience: Simple APIs with sensible defaults
- Performance: Optimized for high-throughput applications
- Reliability: Fault-tolerant designs with proper retry mechanisms
MIT - see the LICENSE file for details.
- 📖 Documentation (coming soon)
- 🐛 Issue Tracker
- 💬 Discussions