This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@chienchheung/nestjs-throttler-storage-redis
TypeScript icon, indicating that this package has built-in type declarations

0.4.1 • Public • Published

NestJS Throttler Redis Storage for @nestjs/throttler ^3.0.0

Tests status

Redis storage provider for the @nestjs/throttler package.

Installation

Yarn

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

NPM

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

Usage

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 {}
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.

Package Sidebar

Install

npm i @chienchheung/nestjs-throttler-storage-redis

Weekly Downloads

1

Version

0.4.1

License

MIT

Unpacked Size

95.3 kB

Total Files

16

Last publish

Collaborators

  • chienchheung