# nest-throttler-storage-redis

> nestjs throttler storage redis service base on node-redis

Latest version **0.0.1** (published 2022-01-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install nest-throttler-storage-redis
pnpm add nest-throttler-storage-redis
yarn add nest-throttler-storage-redis
bun add nest-throttler-storage-redis
```

## Health

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

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

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2022-01-12 |
| First published | 2022-01-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 12.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | jay |
| Maintainers | junxu |
| Keywords | nest, nestjs, throttler, storage, redis |

## Links

- npm: https://www.npmjs.com/package/nest-throttler-storage-redis
- Repository: https://github.com/baaxl9vh/nest-throttler-storage-redis
- Homepage: https://github.com/baaxl9vh/nest-throttler-storage-redis#readme
- Issues: https://github.com/baaxl9vh/nest-throttler-storage-redis/issues
- npm.io page: https://npm.io/package/nest-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.0.1 (latest) — 2022-01-12

## README

# nest-throttler-storage-redis

nestjs throttler storage redis base on node-redis

## Installation

```shell
npm install --save nest-throttler-storage-redis redis
```

## Usage

```javascript
import { Module } from '@nestjs/common';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { APP_GUARD } from '@nestjs/core';
import { ThrottlerGuard, ThrottlerModule } from '@nestjs/throttler';

import { ThrottlerStorageRedisService } from '../../lib';
import { AppController } from './app.controller';
import { AppService } from './app.service';

@Module({
  imports: [
    ConfigModule.forRoot({
      envFilePath: ['.env.test.local', '.env.test'],
    }),
    ThrottlerModule.forRootAsync({
      imports: [ConfigModule],
      inject: [ConfigService],
      useFactory: async (config: ConfigService) => ({
        ttl: 10,
        limit: 5,
        ignoreUserAgents: [/npm-test-user-agent/g],
        storage: new ThrottlerStorageRedisService({
          prefix: 'throttler-test',
          socket: {
            host: config.get('REDIS_HOST'),
            port: config.get('REDIS_PORT'),
          },
        }),
      }),
    }),
  ],
  controllers: [AppController],
  providers: [
    AppService,
    {
      provide: APP_GUARD,
      useClass: ThrottlerGuard,
    },
  ],
})
export class AppModule {}

```

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