# redis-kv-store

> A simple Redis based key/value store.

Latest version **6.2.0** (published 2026-09-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install redis-kv-store
pnpm add redis-kv-store
yarn add redis-kv-store
bun add redis-kv-store
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 6.2.0 |
| Published | 2026-09-04 |
| First published | 2022-05-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=24.14.0 |
| Dependencies | 4 |
| Unpacked size | 26.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Nicolas Froidure |
| Maintainers | nfroidure |
| Keywords | redis, knifecycle |

## Links

- npm: https://www.npmjs.com/package/redis-kv-store
- Repository: https://github.com/nfroidure/redis-kv-store
- Homepage: https://github.com/nfroidure/redis-kv-store#readme
- Issues: https://github.com/nfroidure/redis-kv-store/issues
- Funding: https://github.com/sponsors/nfroidure
- npm.io page: https://npm.io/package/redis-kv-store

## Dependencies (4)

- [knifecycle](https://npm.io/package/knifecycle.md) 21.4.0
- [common-services](https://npm.io/package/common-services.md) ^20.1.0
- [memory-kv-store](https://npm.io/package/memory-kv-store.md) ^10.1.0
- [simple-redis-service](https://npm.io/package/simple-redis-service.md) ^6.1.0

## 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

- 6.2.0 (latest) — 2026-09-04
- 6.1.0 — 2026-08-09
- 6.0.2 — 2026-04-17
- 6.0.1 — 2026-04-07
- 6.0.0 — 2026-03-27
- 5.0.1 — 2025-11-06
- 5.0.0 — 2024-12-04
- 4.0.2 — 2024-07-16
- 4.0.1 — 2023-08-20
- 4.0.0 — 2023-08-17
- 3.0.0 — 2023-08-12
- 2.0.2 — 2023-01-05
- 2.0.1 — 2022-09-01
- 2.0.0 — 2022-06-12
- 1.0.0 — 2022-05-26

## README

[//]: # ( )
[//]: # (This file is automatically generated by a `metapak`)
[//]: # (module. Do not change it  except between the)
[//]: # (`content:start/end` flags, your changes would)
[//]: # (be overridden.)
[//]: # ( )
# redis-kv-store
> A simple Redis based key/value store.

[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/nfroidure/redis-kv-store/blob/main/LICENSE)


[//]: # (::contents:start)

This simple project provides a key/value store based on Redis. It has the exact
same API then the
[`memory-kv-store`](https://github.com/nfroidure/memory-kv-store) module and
relies on the [`redis-service`](https://github.com/nfroidure/redis-service)
module.

[//]: # (::contents:end)

# API
<a name="initRedisKV"></a>

## initRedisKV(services) ⇒ <code>Promise.&lt;RedisKVService&gt;</code>
Instantiate the Redis Key/Value service

**Kind**: global function  
**Returns**: <code>Promise.&lt;RedisKVService&gt;</code> - A promise of the Redis Key Value service  

| Param | Type | Description |
| --- | --- | --- |
| services | <code>Object</code> | The services to inject |
| services.redis | <code>function</code> | A `simple-redis-service` instance |
| services.log | <code>function</code> | A logging function |

**Example**  
```js
import initRedisService from 'simple-redis-service';
import initRedisKV from 'redis-kv-store';

const redis = await initRedisService({
  REDIS: {
    host: 'localhost',
    port: 6379,
  },
  ENV: process.env,
  log: console.log.bind(console),
});
const redisKV = await initRedisKV({
  redis,
  log: console.log.bind(console),
});

const value = await redisKV.get('my_key');
```

# Authors
- [Nicolas Froidure](http://insertafter.com/en/index.html)

# License
[MIT](https://github.com/nfroidure/redis-kv-store/blob/main/LICENSE)

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