# node-ts-cache-storage-ioredis

> Redis storage module for node-ts-cache

Latest version **4.4.0** (published 2021-10-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-ts-cache-storage-ioredis
pnpm add node-ts-cache-storage-ioredis
yarn add node-ts-cache-storage-ioredis
bun add node-ts-cache-storage-ioredis
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.4.0 |
| Published | 2021-10-11 |
| First published | 2020-12-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 9.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 50 |
| Author | Himmet Avsar |
| Maintainers | havsar |
| Keywords | node, nodejs, cache, typescript, ts, caching, memcache, memory-cache, redis-cache, redis, cache, file-cache, node-cache, ts-cache |

## Links

- npm: https://www.npmjs.com/package/node-ts-cache-storage-ioredis
- Repository: https://github.com/havsar/node-ts-cache
- Homepage: https://github.com/havsar/node-ts-cache#readme
- Issues: https://github.com/havsar/node-ts-cache/issues
- npm.io page: https://npm.io/package/node-ts-cache-storage-ioredis

## Dependencies (4)

- [debug](https://npm.io/package/debug.md) ^4.3.2
- [ioredis](https://npm.io/package/ioredis.md) ^4.27.10
- [ioredis-mock](https://npm.io/package/ioredis-mock.md) ^5.6.0
- [node-ts-cache](https://npm.io/package/node-ts-cache.md) ^4.4.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

- 4.4.0 (latest) — 2021-10-11
- 4.3.4 — 2021-10-08
- 4.2.3 — 2020-12-31
- 4.2.2 — 2020-12-31
- 4.2.1 — 2020-12-31

## README

IoRedis storage module for [node-ts-cache](https://www.npmjs.com/package/node-ts-cache).

An IoRedis instance must be created and passed to the library.
See https://github.com/luin/ioredis#connect-to-redis for available options.

```bash
npm i node-ts-cache
npm i node-ts-cache-storage-ioredis
npm i ioredis
npm i -D @types/ioredis
```

```ts
import { Cache, CacheContainer } from "node-ts-cache"
import { IoRedisStorage } from "node-ts-cache-storage-ioredis"
import IoRedis from "ioredis"

const ioRedisInstance = new IoRedis({
    port: 6379, // Redis port
    host: "127.0.0.1", // Redis host
    family: 4, // 4 (IPv4) or 6 (IPv6)
    password: "auth",
    db: 0
})
const userCache = new CacheContainer(new IoRedisStorage(ioRedisInstance))

class MyService {
    @Cache(userCache, { ttl: 60 })
    public async getUsers(): Promise<string[]> {
        return ["Max", "User"]
    }
}
```

---
_Source: https://npm.io/package/node-ts-cache-storage-ioredis · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
