# simple-redis-service

> A simple Redis wrapper around the ioredis module.

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

## Install

```sh
npm install simple-redis-service
pnpm add simple-redis-service
yarn add simple-redis-service
bun add simple-redis-service
```

## 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.1.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 | 22.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Nicolas Froidure |
| Maintainers | nfroidure |
| Keywords | redis, knifecycle |

## Links

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

## Dependencies (4)

- [yerror](https://npm.io/package/yerror.md) ^11.0.0
- [ioredis](https://npm.io/package/ioredis.md) 6.0.0
- [knifecycle](https://npm.io/package/knifecycle.md) 21.4.0
- [common-services](https://npm.io/package/common-services.md) ^20.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.1.0 (latest) — 2026-09-04
- 6.0.2 — 2026-04-17
- 6.0.1 — 2026-04-07
- 6.0.0 — 2026-03-27
- 5.1.1 — 2025-11-06
- 5.1.0 — 2024-12-04
- 5.0.0 — 2024-12-04
- 4.0.4 — 2024-07-16
- 4.0.3 — 2024-05-28
- 4.0.2 — 2023-11-09
- 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 more at https://npm.io/package/simple-redis-service/versions

## 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.)
[//]: # ( )
# simple-redis-service
> A simple Redis wrapper around the ioredis module.

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


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

This simple project is intended to mock real key value stores likes Redis or
 file system based stores. It can also be used in local scripts to run code
 that assume a key value store exists.

It requires a `delay` services to be passed in, you can find an implementation
 in the [`common-services`](https://github.com/nfroidure/common-services)
 project.

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

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

## initRedisService(services) ⇒ <code>Promise.&lt;RedisService&gt;</code>
Instantiate the Redis service

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

| Param | Type | Description |
| --- | --- | --- |
| services | <code>Object</code> | The services to inject |
| [services.ENV] | <code>Object</code> | An environment object |
| services.REDIS | <code>function</code> | The configuration object as given to `node-redis` |
| [services.REDIS_PASSWORD_ENV_NAME] | <code>function</code> | The environment variable name in which to pick-up the  Redis password |
| services.log | <code>function</code> | A logging function |

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

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

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

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

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

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