Connect a Node.js backend to Redis for caching database query results using promises or async/await syntax.
Build pub/sub messaging between Node.js services using ioredis's subscribe and publish commands.
Talk to a Redis Cluster from Node.js with automatic sharding and failover handled by ioredis.
Requires a running Redis server, the library is in maintenance mode, new projects should use node-redis per the maintainers' recommendation.
ioredis is a Redis client library for Node.js, written in TypeScript. Redis is a fast in-memory data store that programs use to keep things like cached query results, session info, counters, or message queues, a client library is the piece of code your application uses to talk to it. The README describes ioredis as robust, performance-focused, and full-featured, and says it is used at Alibaba and other large companies. The README lists the features it covers: connecting to a single Redis server, to Redis Cluster (Redis split across many machines), and to Redis Sentinel (a high-availability setup), as well as Streams, Pipelining (batching commands for speed), Pub/Sub (publish-subscribe messaging, including binary payloads), Lua scripting, and Redis Functions. It exposes both Node.js callbacks and native promises, so you can write either style, and it includes things like transparent key prefixing, TLS encryption support, ACL support, an offline queue, autopipelining, and binary data handling. Connection options can be passed as a host and port, a redis:// URL, or a unix socket path. You would use ioredis when you are building a Node.js application and need to read from or write to Redis. Important caveat from the README itself: ioredis is now in best-effort maintenance mode, and for new projects the maintainers recommend a sibling library called node-redis, which they say has been redesigned and supports newer Redis features. It is installed through npm and works with Node.js 12 or newer for the latest version. The full README is longer than what was provided.
← redis on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.