A Node.js library for talking to Redis and Redis Cluster with promises, pipelining, pub/sub, streams, and TypeScript types.
Overview
ioredis is a Redis client aimed at Node.js applications that need robust connection handling and a broad command surface. It supports standalone Redis, Sentinel, and Cluster topologies, targets compatibility with recent Redis releases, and ships with official TypeScript declarations.
The API works with callbacks or native promises and covers strings, hashes, lists, sets, sorted sets, streams, TTL, pub/sub, transactions, pipelining, Lua scripting helpers, and transparent key prefixing. Features called out include TLS, ACL support, binary payloads, offline queues, autopipelining, and argument or reply transformers such as returning objects from HGETALL.
Connections can be created from host options or redis:// and rediss:// URLs. Pub/sub requires separate connections when publishing and subscribing on one process. Cluster and experimental HIMPORT fieldset helpers are documented for newer Redis versions.
Project notes describe maintenance on a best-effort basis and point new projects to the separate node-redis client for greenfield work, while ioredis remains widely deployed in existing codebases.
Key features
- Redis, Sentinel, and Cluster support
- Promises and pipelining
- Pub/sub and Redis Streams
- Lua scripting with defineCommand
- TLS and Redis ACL support
- Binary-safe commands and replies
- Key prefixing and reply transformers
- TypeScript type definitions
Use cases
- Application caching with Redis
- Pub/sub event fan-out in Node
- Cluster-aware Redis access
- Transactional queue processing
- Custom Redis commands via Lua