# @keyvhq/redis

> Redis storage adapter for Keyv — fast TTL cache backed by Redis or Valkey.

Latest version **2.2.12** (published 2026-10-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install @keyvhq/redis
pnpm add @keyvhq/redis
yarn add @keyvhq/redis
bun add @keyvhq/redis
```

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 2.2.12 |
| Published | 2026-10-28 |
| First published | 2021-04-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 447 |
| Author | microlink.io |
| Maintainers | kikobeats, jytesh |
| Keywords | adapter, cache, ioredis, keyv, memory, redis, storage, store, ttl, valkey |

## Links

- npm: https://www.npmjs.com/package/@keyvhq/redis
- Repository: https://github.com/microlinkhq/keyv
- Issues: https://github.com/microlinkhq/keyvhq/issues
- npm.io page: https://npm.io/package/@keyvhq/redis

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 2.2.12 (latest) — 2026-10-28
- 2.2.10 — 2026-10-28
- 2.2.9 — 2026-10-28
- 2.2.8 — 2026-10-28
- 2.2.7 — 2026-08-03
- 2.2.3 — 2026-05-26
- 2.1.17 — 2026-03-01
- 2.1.15 — 2026-02-04
- 2.1.13 — 2026-02-04
- 2.1.12 — 2026-01-11
- 2.1.11 — 2025-09-24
- 2.1.10 — 2025-07-31
- 2.1.8 — 2025-03-13
- 2.1.7 — 2025-02-20
- 2.1.5 — 2024-07-30
- … 31 more at https://npm.io/package/@keyvhq/redis/versions

## README

# @keyvhq/redis [<img width="100" align="right" src="https://keyvhq.js.org/media/logo-sunset.svg" alt="keyv">](https://github.com/microlinkhq/keyv/packages/redis)

> Redis storage adapter for [Keyv](https://github.com/microlinkhq/keyv).

TTL functionality is handled directly by Redis so no timestamps are stored and expired keys are cleaned up internally.

## Install

```shell
npm install --save @keyvhq/core @keyvhq/redis
```

## Usage

```js
const KeyvRedis = require('@keyvhq/redis')
const Keyv = require('@keyvhq/core')

const keyv = new Keyv({ store: new KeyvRedis('redis://user:pass@localhost:6379') })
```

Any valid [`Redis`](https://github.com/luin/ioredis#connect-to-redis) options will be passed directly through:

```js
const KeyvRedis = require('@keyvhq/redis')
const Keyv = require('@keyvhq/core')

const keyv = new Keyv({
  store: new KeyvRedis('redis://user:pass@localhost:6379', {
    disable_resubscribing: true
  })
})
```

Or you can reuse a previously declared `Redis` instance:

```js
const KeyvRedis = require('@keyvhq/redis')
const Keyv = require('@keyvhq/core')

const { Redis } = KeyvRedis

const redis = new Redis('redis://user:pass@localhost:6379')
const keyv = new Keyv({ store: new KeyvRedis(redis) })
```

## License

**@keyvhq/redis** © [Luke Childs](https://lukechilds.co), released under the [MIT](https://github.com/microlinkhq/keyvhq/blob/master/LICENSE.md) License.<br/>
Maintained by [Microlink](https://microlink.io) with help from [contributors](https://github.com/microlinkhq/keyvhq/contributors).

> [microlink.io](https://microlink.io) · GitHub [microlinkhq](https://github.com/microlinkhq) · X [@microlinkhq](https://x.com/microlinkhq)

---
_Source: https://npm.io/package/@keyvhq/redis · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
