Skip to content

ioredis

A Node.js client for Redis, written in TypeScript, with Cluster, Sentinel, and Streams support.

Stars
15.4k
Forks
1.3k
Licence
MIT
Language
TypeScript
Last update
4 days ago
Type
Library

What it is

ioredis is a Redis client library for Node.js. It lets your JavaScript or TypeScript code send commands to a Redis server and read the results, using either callbacks or promises. It also covers Redis Cluster, Sentinel, Pub/Sub, Lua scripting, and TLS connections.

  • Store and read cached values with simple get and set calls
  • Publish messages to channels and subscribe to them with Pub/Sub
  • Process event data with Redis Streams
  • Run Lua scripts or Redis Functions from Node.js code
  • Connect to a Redis Cluster or Sentinel setup with a single client API

Great for

  • Node.js backend developers who already run Redis and want a full-featured client
  • Teams maintaining existing projects that already depend on ioredis
  • Apps that use Redis Cluster or Sentinel for high availability
  • TypeScript projects that want built-in type declarations

Not ideal for

  • New projects: the README says node-redis is the recommended client for new projects and that ioredis is in best-effort maintenance
  • Projects that need Redis Stack features like search or JSON as a first-class API, since the README points to node-redis for those
  • Non-Node.js environments, since this is a Node.js client
Step-by-step guide: how to use ioredisInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: Node.js 20 or newer (for v6, per the README version table) · A running Redis server (the default connection is localhost:6379)

    Install the library

    npm install ioredis

    Optional: add Node.js type declarations in a TypeScript project

    npm install --save-dev @types/node
  2. 2

    Run it

    • Install the package with npm install ioredis.
    • Create a client with const Redis = require("ioredis") and const redis = new Redis().
    • Call a command such as redis.set("mykey", "value") and read it back with redis.get("mykey").
    • Pass connection options or a redis:// URL to the constructor if your server is not on localhost:6379.
  3. 3

    Get the most out of it

    • Use a redis:// or rediss:// connection string, with rediss:// for TLS, to configure connections in one line
    • Use the Cluster and Sentinel classes when you run a high-availability Redis setup
    • Define custom commands through the Lua scripting abstraction
    • Use the examples/ folder in the repository for working code on hashes, lists, sets, sorted sets, and streams

Downloads

Strengths

  • Covers a wide range of Redis features, including Cluster, Sentinel, Streams, and TLS
  • Ships with official TypeScript declarations and is written in TypeScript
  • Supports both Node callbacks and native promises

Trade-offs

  • The README says ioredis is in best-effort maintenance and recommends node-redis for new projects
  • Requires Node.js 20 or newer for the current v6 release, according to the version table

How it compares

ProjectStarsTypeLevelUpdatedBest for
ioredis (this)15.4kLibrarybeginner4 days agoNode.js backend developers who already run Redis and want a full-featured client
node-redis17.6kLibraryintermediate4 days agoNode.js developers who need to read and write Redis data from an application
redis-py13.7kLibrarybeginner4 days agoPython developers who need to read and write data in a Redis server
jedis12.4kLibraryintermediate5 days agoJava developers who need to read and write data in Redis from an application
AnotherRedisDesktopManager34.8kAppbeginner3 months agoDevelopers who prefer a visual interface over redis-cli for inspecting keys
medis11.7kAppintermediate2.7 years agoDevelopers who want a visual way to inspect Redis keys on a Mac

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.