Packages

ioredis

6.1.0 · 23 Nov 2026MIT45.2M / weekRepositoryHomepagenpmAtom feed

Your version

4.0.0

major14 Aug 2018Where it was published

4.31.0 is the newest release of 4.x.

In short

7 breaking1 security7 new1 faster5 fixed

  • Breaking

    **This is a major release and contain breaking changes.

  • Breaking

    Drop support for < node v6

  • Breaking

    Use native Promise instead of Bluebird. This change makes all the code that rely on the features provided by Bluebird not working anymore. For example, redis.get('foo').timeout(500) now should be failed since the native Promise doesn't support the timeout method. You can switch back to the Bluebird implementation by setting Redis.Promise:

  • Breaking

    Redis#connect() will be resolved when status is ready instead of connect:

  • Breaking

    Cluster#connect() will be resolved when the connection status become ready instead of connect.

  • Breaking

    The maxRetriesPerRequest is set to 20 instead of null (same behavior as ioredis v3) by default. So when a redis server is down, pending commands won't wait forever until the connection become alive, instead, they only wait about 10s (depends on the retryStrategy option)

  • Breaking

    The new keyword is required explicitly. Calling Redis as a function like Redis(/* options /)is deprecated and will not be supported in the next major version, usenew Redis(/ options */)` instead.

  • Security

    Solves vulnerabilities dependencies

Release note

This is a major release and contain breaking changes. Please read this changelog before upgrading.

Changes since 4.0.0-3

Bug Fixes

  • Port is ignored when path set to null (d40a99e), closes #668

Features

  • Export Pipeline for inheritances enabling

  • Export ScanStream at package level

Changes since 3.x

Bug Fixes

  • Sentinel: unreachable errors when sentinals are healthy

  • Resolve warning for Buffer() in Node.js 10

  • Don't add cluster.info to the failover queue before ready

  • Security

    Solves vulnerabilities dependencies

  • Cluster: issues when setting enableOfflineQueue to false

Performance Improvements

  • Upgrade redis-parser for better performance.

Features

  • Use native Promise instead of Bluebird, and allow users to switch back.

  • Add maxRetriesPerRequest option to limit the retries attempts per command

  • Redis#connect() will be resolved when status is ready

  • Add debug details for connection pool

  • Wait for ready state before resolving cluster.connect()

Breaking changes

  • Breaking

    Drop support for < node v6

  • Breaking

    Use native Promise instead of Bluebird. This change makes all the code that rely on the features provided by Bluebird not working
    anymore. For example, redis.get('foo').timeout(500) now should be failed since the native
    Promise doesn't support the timeout method. You can switch back to the Bluebird
    implementation by setting Redis.Promise:

const Redis = require('ioredis')
Redis.Promise = require('bluebird')

const redis = new Redis()

// Use bluebird
assert.equal(redis.get().constructor, require('bluebird'))

// You can change the Promise implementation at any time:
Redis.Promise = global.Promise
assert.equal(redis.get().constructor, global.Promise)
  • Breaking

    Redis#connect() will be resolved when status is ready
    instead of connect:

const redis = new Redis({ lazyConnect: true })
redis.connect().then(() => {
  assert(redis.status === 'ready')
})
  • Breaking

    Cluster#connect() will be resolved when the connection
    status become ready instead of connect.

  • Breaking

    The maxRetriesPerRequest is set to 20 instead of null (same behavior as ioredis v3)
    by default. So when a redis server is down, pending commands won't wait forever
    until the connection become alive, instead, they only wait about 10s (depends on the
    retryStrategy option)

  • Breaking

    The new keyword is required explicitly. Calling Redis as a function like
    Redis(/* options /)is deprecated and will not be supported in the next major version, usenew Redis(/ options */)` instead.

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.