ioredis
Robust, full-featured Redis client for Node.js — Cluster, Sentinel, pipelining, Lua scripting, and Streams support.
ioredis
Node.jsRobust, full-featured Redis client for Node.js — Cluster, Sentinel, pipelining, Lua scripting, and Streams support.
Fit
Bundle (gzip)
43.0 kB
149.0 kB raw
Install size includes transitive dependencies. Bundle size is gzipped browser payload.
Freshness
The Problem
The basic redis npm package lacks built-in support for Redis Cluster, Sentinel failover, automatic reconnection, and command pipelining — all critical features for production deployments.
What It Does
ioredis handles Redis Cluster topology automatically, reconnects on failure with exponential backoff, supports pipelining and transactions for batching commands, and provides first-class TypeScript types for all commands. It also supports Redis Streams for event sourcing patterns.
Installation
npm install ioredisUsage Example
import Redis from 'ioredis';
const redis = new Redis({
host: process.env.REDIS_HOST,
port: 6379,
retryStrategy: (times) => Math.min(times * 50, 2000),
});
// Simple operations
await redis.set('session:123', JSON.stringify({ userId: 456 }), 'EX', 3600);
const session = await redis.get('session:123');
// Pipelining
const pipeline = redis.pipeline();
pipeline.set('key1', 'val1');
pipeline.get('key2');
const results = await pipeline.exec();Related packages
Role and attribute based access control (RBAC + ABAC) for Node.js with a fluent, readable API.
bcryptjsNode.jsPure JavaScript bcrypt password hashing — no native dependencies, same API as bcrypt, works anywhere Node.js runs.
bullmqNode.jsPremium message queue and job scheduler for Node.js backed by Redis — reliable background job processing with retries, priorities, and rate limiting.
casbinNode.jsA powerful authorization library that supports RBAC, ABAC, ACL and more via configurable policy models.
dotenvNode.jsLoad environment variables from a `.env` file into `process.env` — the standard way to manage configuration in Node.js apps.