# @chienchheung/nestjs-throttler-storage-redis

> Redis storage provider for the @nestjs/throttler package

Latest version **0.4.1** (published 2022-07-12) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @chienchheung/nestjs-throttler-storage-redis
pnpm add @chienchheung/nestjs-throttler-storage-redis
yarn add @chienchheung/nestjs-throttler-storage-redis
bun add @chienchheung/nestjs-throttler-storage-redis
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.4.1 |
| Published | 2022-07-12 |
| First published | 2022-07-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 93 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Kim 金可明 |
| Maintainers | chienchheung |
| Keywords | nestjs, rate-limit, throttle, express, fastify, redis |

## Links

- npm: https://www.npmjs.com/package/@chienchheung/nestjs-throttler-storage-redis
- Repository: https://github.com/Chheung/nestjs-throttler-storage-redis
- Homepage: https://github.com/Chheung/nestjs-throttler-storage-redis#readme
- Issues: https://github.com/Chheung/nestjs-throttler-storage-redis/issues
- npm.io page: https://npm.io/package/@chienchheung/nestjs-throttler-storage-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

- 0.4.1 (latest) — 2022-07-12
- 0.4.0 — 2022-07-12
- 0.3.0 — 2022-07-12

## README

# NestJS Throttler Redis Storage for @nestjs/throttler ^3.0.0

![Tests status](https://img.shields.io/github/workflow/status/kkoomen/nestjs-throttler-storage-redis/Tests/master)

Redis storage provider for the [@nestjs/throttler](https://github.com/nestjs/throttler) package.

# Installation

### Yarn

- `yarn add @chienchheung/nestjs-throttler-storage-redis ioredis`

### NPM

- `npm install --save @chienchheung/nestjs-throttler-storage-redis ioredis`

# Usage

```ts
import { ThrottlerModule } from '@nestjs/throttler';
import { ThrottlerStorageRedisService } from '@chienchheung/nestjs-throttler-storage-redis';

@Module({
  imports: [
    ThrottlerModule.forRoot({
      ttl: 60,
      limit: 5,
      storage: new ThrottlerStorageRedisService(),
    }),
  ],
})
export class AppModule {}
```

```ts
import { ThrottlerModule } from '@nestjs/throttler';
import { ThrottlerStorageRedisService } from '@chienchheung/nestjs-throttler-storage-redis';

@Module({
  imports: [
    ThrottlerModule.forRootAsync({
      imports: [ConfigModule],
      inject: [ConfigService],
      useFactory: (config: ConfigService) => ({
        ttl: config.get('THROTTLE_TTL'),
        limit: config.get('THROTTLE_LIMIT'),
        storage: new ThrottlerStorageRedisService(),
      }),
    }),
  ],
})
export class AppModule {}
```

# Issues

Bugs and features related to the redis implementation are welcome in this
repository.

# License

NestJS Throttler Redis Storage is licensed under the MIT license.

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