ioredis

A robust, full-featured Redis client for Node.js with built-in Cluster, Sentinel, and TypeScript support.

Library
npm
v6.0.0
15,343 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
92 /100 Excellent
Development Activity 96
Maintenance 96
Community 76
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
83 /100 Excellent
Architecture 82
Code Quality 85
Innovation 80
Learning Curve 85

ioredis is a battle-tested Redis client for Node.js, originally created by Zihua Li at Alibaba and now maintained by the Redis team. It ships as a single TypeScript codebase with minimal, single-purpose runtime dependencies, exposing nearly every Redis command as a same-named Promise-returning method while still supporting the classic Node.js callback style.

Beyond basic get/set operations, ioredis provides first-class support for Redis Cluster and Sentinel-based high availability, transparent pipelining and autopipelining for throughput, MULTI/EXEC transactions, Lua scripting with automatic script caching, binary-safe Pub/Sub, and TLS. It has powered production traffic at large-scale deployments for a decade and remains one of the two most widely used Node.js Redis clients alongside node-redis.

What You Get

  • Complete Redis command coverage exposed as Promise- and callback-based methods matching the official command names
  • Native support for Redis Cluster (slot routing, MOVED/ASK redirection) and Sentinel-based automatic failover
  • Pipelining, autopipelining, and MULTI/EXEC transactions for batching and atomic operations
  • A Lua scripting abstraction (defineCommand) with automatic EVALSHA caching
  • First-class TypeScript declarations, TLS support, and binary-safe Pub/Sub

Common Use Cases

  • Caching layer in front of a primary database to cut read latency and DB load
  • Session storage and rate-limiting counters for web APIs
  • Distributed locks, leaderboards, and real-time counters built on Redis data structures
  • Backing store for Pub/Sub messaging or lightweight job queues on Redis Streams/Lists

Under The Hood

Architecture - The Redis class (lib/Redis.ts, ~1,050 lines) extends a Commander mixin that generates a method per Redis command from the @ioredis/commands metadata table. Connection lifecycle is delegated to pluggable connectors (StandaloneConnector for direct connections, SentinelConnector for HA failover) and driven through explicit states (wait -> connecting -> connect -> ready -> close -> end) via lib/redis/event_handler.ts. Commands are serialized and matched to replies by Command.ts (~615 lines) working with DataHandler.ts (~295 lines), which parses the raw socket byte stream with redis-parser and resolves pending commands off a Deque-backed queue. Cluster support is a parallel implementation (lib/cluster/index.ts, ~1,260 lines) that wraps a pool of per-node Redis instances, handles MOVED/ASK redirection, and computes slot ownership via cluster-key-slot. Pipelining and transactions (Pipeline.ts, transaction.ts) and Lua script caching (Script.ts) are layered on top of this core, and autoPipelining.ts transparently batches same-tick commands into a single round trip.

Tech Stack - 100% TypeScript (98.7% of the codebase by bytes), compiled with tsc into a built/ directory that is the package’s actual entry point. Runtime dependencies are deliberately minimal and single-purpose: @ioredis/commands (command metadata/flags), redis-parser (RESP protocol parsing), redis-errors, cluster-key-slot (CRC16 slot hashing), denque (queue for pending commands), debug (namespaced logging), and standard-as-callback (dual promise/callback API). No framework dependencies. Targets Node.js >=12.22.0 and is compatible with Redis 2.6.12 through the latest 7.x/8.x releases.

Code Quality - 111 test files spread across a genuinely three-tiered strategy: test/unit for isolated logic, test/functional for command-by-command tests run against a real Redis server, test/cluster for Docker Compose-backed Cluster/Sentinel scenarios, and test/typing for tsd compile-time type assertions. ESLint extends eslint:recommended plus @typescript-eslint/recommended and prettier; coverage is tracked with nyc and reported to Coveralls. Error handling is centralized through the redis-errors package and a configurable ReconnectOnError policy. Releases are gated on the test suite and driven by semantic-release with commitizen-style conventional commits.

API Design - new Redis() connects to localhost:6379 with zero configuration, and every Redis command is exposed as a same-named method returning a Promise (Node-style callbacks are also supported via standard-as-callback), so the public API mirrors the Redis command reference almost 1:1. Chained .pipeline()/.multi() builders give fluent batch and transaction ergonomics, and defineCommand abstracts away hand-rolled EVALSHA caching for custom Lua scripts. A 69KB README covers connection options, Cluster/Sentinel setup, TLS, and scripting, backed by a generated TypeDoc API reference and a dedicated examples/ directory (including TypeScript and Express samples) — a fairly gentle learning curve for a low-level client, docked slightly by the inherent complexity of Cluster/Sentinel configuration.

Used by 81 apps in this directory

TypeScript
76%
AGPL 3.0

Abby

Developer Tools · Product Management

166

Statically typed feature flags, remote config, and A/B testing with framework-native SDKs for TypeScript teams.

View details
31
Repo Health
70
Technical
64
Dependency
Built with
TypeScript 76%
MDX 18%
Updated 1 years ago
TypeScript
100%
Other

Activepieces

AI Assistants · Automation · Mcp

24,756

Open-source AI automation platform that converts 280+ workflow integrations into MCP servers for LLMs, with no-code builders and TypeScript extensibility.

View details
92
Repo Health
85
Technical
64
Dependency
Built with
TypeScript 100%
Updated 4 days ago
TypeScript
82%
Other

AFFiNE

Collaboration · Note Taking · Productivity

73,040

Write, draw, and plan in one infinite canvas — the open-source alternative to Notion and Miro that keeps your data yours.

View details
91
Repo Health
87
Technical
67
Dependency
Built with
TypeScript 82%
Rust 11%
Updated 5 days ago
TypeScript
72%
AGPL 3.0

APITable

Databases · Low Code Platforms

15,623

API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.

View details
71
Repo Health
77
Technical
60
Dependency
Built with
TypeScript 72%
Java 22%
Updated 3 weeks ago
TypeScript
96%
Other

Amplication

AI Code Assistants · Automation · Developer Tools

16,015

Create production-ready backend services with your organization's standards baked in — generating NestJS, Prisma, and GraphQL code that you own and control.

View details
58
Repo Health
84
Technical
60
Dependency
Built with
TypeScript 96%
Updated 3 months ago
JavaScript
94%
MIT

Another Redis Desktop Manager

Databases · Developer Tools

34,787

Fast, stable Redis GUI with cluster, SSH, and massive key support

View details
81
Repo Health
56
Technical
67
Dependency
Built with
JavaScript 94%
Updated 1 months ago
TypeScript
97%
AGPL 3.0

Bigcapital

Invoicing Finance

3,916

Self-hostable double-entry accounting platform with invoicing, inventory, multi-currency, and real-time financial reporting for small and medium businesses.

View details
90
Repo Health
77
Technical
61
Dependency
Built with
TypeScript 97%
Updated 6 days ago
TypeScript
70%
Other

Budibase

Low Code Platforms · No Code Platforms

28,324

Build AI agents, automations, and internal apps on a single open-source platform with full self-hosting control.

View details
91
Repo Health
81
Technical
63
Dependency
Built with
TypeScript 70%
Svelte 26%
Updated 1 weeks ago
TypeScript
93%
MIT

bunqueue

Developer Tools · Devops

570

High-performance job queue for Bun — SQLite persistence, cron scheduling, DLQ, S3 backups, and a native MCP server, all without Redis.

View details
73
Repo Health
83
Technical
72
Dependency
Built with
TypeScript 93%
Updated 3 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers