# @anchan828/nest-cache-manager-ioredis

Latest version **3.1.28** (published 2025-01-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install @anchan828/nest-cache-manager-ioredis
pnpm add @anchan828/nest-cache-manager-ioredis
yarn add @anchan828/nest-cache-manager-ioredis
bun add @anchan828/nest-cache-manager-ioredis
```

## Health

**Score 40/100 (D)** — status: maintenance-mode.

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

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.1.28 |
| Published | 2025-01-26 |
| First published | 2019-09-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 24.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | anchan828 <anchan828@gmail.com> |
| Maintainers | anchan828 |

## Links

- npm: https://www.npmjs.com/package/@anchan828/nest-cache-manager-ioredis
- Repository: https://github.com/anchan828/nest-cache
- Homepage: https://github.com/anchan828/nest-cache#readme
- Issues: https://github.com/anchan828/nest-cache/issues
- npm.io page: https://npm.io/package/@anchan828/nest-cache-manager-ioredis

## Dependencies (4)

- [ioredis](https://npm.io/package/ioredis.md) ^5.4.1
- [msgpackr](https://npm.io/package/msgpackr.md) ^1.11.0
- [cache-manager](https://npm.io/package/cache-manager.md) ^5.7.6
- [@anchan828/nest-cache-common](https://npm.io/package/@anchan828/nest-cache-common.md) ^3.1.28

## Recent versions

- 3.1.28 (latest) — 2025-01-26
- 3.1.27 — 2025-01-19
- 3.1.26 — 2025-01-12
- 3.1.25 — 2025-01-05
- 3.1.24 — 2024-12-29
- 3.1.23 — 2024-12-22
- 3.1.22 — 2024-12-15
- 3.1.21 — 2024-12-08
- 3.1.20 — 2024-12-01
- 3.1.19 — 2024-11-24
- 3.1.18 — 2024-11-17
- 3.1.17 — 2024-11-10
- 3.1.16 — 2024-11-03
- 3.1.15 — 2024-10-27
- 3.1.14 — 2024-10-20
- … 329 more at https://npm.io/package/@anchan828/nest-cache-manager-ioredis/versions

## README

# @anchan828/nest-cache-manager-ioredis

![npm](https://img.shields.io/npm/v/@anchan828/nest-cache-manager-ioredis.svg)
![NPM](https://img.shields.io/npm/l/@anchan828/nest-cache-manager-ioredis.svg)

## Description

Redis store for node-cache-manager using IORedis.

## Installation

```bash
$ npm i --save @anchan828/nest-cache-manager-ioredis
```

## Quick Start

```ts
import { redisStore } from "@anchan828/nest-cache-manager-ioredis";
import { caching } from "cache-manager";

caching({
  store: redisStore,
  host: "localhost",
});
```

## Use AsyncLocalStorage

You can cache results of redis to `AsyncLocalStorage<Map<string, any>>`.

```ts
const asyncLocalStorage = new AsyncLocalStorage<Map<string, any>>();

caching({
  store: redisStore,
  host: "localhost",
  asyncLocalStorage: asyncLocalStorage,
});


...


asyncLocalStorage.run(new Map(), ()=>{
  ...
})
```

## Notes

- This package uses MessagePack for efficient serialization/deserialization.
  - The most obvious is to serialize/deserialize a Date object with JSON. JSON.parse does not support Date object, so you need to implement the receiver yourself. Checking and parsing properties one by one as strings is an inefficient and very time-consuming process.

## License

[MIT](LICENSE)

---
_Source: https://npm.io/package/@anchan828/nest-cache-manager-ioredis · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
