Registry / devops / nest-throttler-storage-redis

nest-throttler-storage-redis

JSON →
library0.0.1jsnpmunverified

A Redis storage adapter for @nestjs/throttler using node-redis. Provides a ThrottlerStorageRedisService class that integrates with NestJS's ThrottlerModule for distributed rate limiting. Version 0.0.1 is pre-stable and unmaintained. Uses the modern node-redis v4 driver. Ships TypeScript types. Requires manual installation of redis peer dependency. Suitable for NestJS applications needing scalable, multi-instance throttling with Redis.

npm install nest-throttler-storage-redis
INSTALL
IMPORT
SIG · NEST-THROTTLER-STO
N
nest-throttler-storage-redis
devopsjavascriptv0.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ThrottlerStorageRedisService
import { ThrottlerStorageRedisService } from 'nest-throttler-storage-redis'
const ThrottlerStorageRedisService = require('nest-throttler-storage-redis')
Package is ESM-only.
ThrottlerStorageRedisService (named import with destructuring)
import { ThrottlerStorageRedisService } from 'nest-throttler-storage-redis'
import ThrottlerStorageRedisService from 'nest-throttler-storage-redis'
Only named export is available, no default export.
ThrottlerStorageRedisService in CommonJS
const { ThrottlerStorageRedisService } = require('nest-throttler-storage-redis')
const ThrottlerStorageRedisService = require('nest-throttler-storage-redis')
CommonJS require must use destructuring; direct assignment to the require result will be undefined.
Type import for ThrottlerStorageRedisService
import type { ThrottlerStorageRedisService } from 'nest-throttler-storage-redis'
import { ThrottlerStorageRedisService } from 'nest-throttler-storage-redis'
When using only types, prefer type import to avoid bundling unused code.

Shows how to configure NestJS ThrottlerModule with Redis storage using async module registration and ConfigService.

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 'nest-throttler-storage-redis'; @Module({ imports: [ ConfigModule.forRoot(), ThrottlerModule.forRootAsync({ imports: [ConfigModule], inject: [ConfigService], useFactory: async (config: ConfigService) => ({ ttl: 60, limit: 10, storage: new ThrottlerStorageRedisService({ socket: { host: config.get<string>('REDIS_HOST', 'localhost'), port: config.get<number>('REDIS_PORT', 6379), }, prefix: 'throttler', }), }), }), ], controllers: [], providers: [ { provide: APP_GUARD, useClass: ThrottlerGuard, }, ], }) export class AppModule {}
Debug
Known issues
gotchaPackage is pre-stable (v0.0.1) and has not been maintained; use only for experimental projects.
fix
Consider using @nestjs/throttler-storage-redis or nestjs-throttler-redis-storage for production.
affects: <0.1.0
breakingRequires redis client as peer dependency - not installed automatically.
fix
Run: npm install redis
affects: >=0.0.0
gotchaConstructor options differ from other throttler storage adapters; uses node-redis v4 style: socket, prefix, etc.
fix
Refer to documentation for node-redis options; older adapters may use url or legacy options.
affects: >=0.0.0
deprecated@nestjs/throttler v5 introduced IStorage interface changes; this package may not be compatible with latest versions.
fix
Check @nestjs/throttler version; update package or switch to official storage packages.
affects: >=0.0.0
gotchaCommonJS require must use destructuring; direct require returns undefined.
fix
Use const { ThrottlerStorageRedisService } = require('nest-throttler-storage-redis')
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'nest-throttler-storage-redis'
Package not installed
fix
npm install nest-throttler-storage-redis
TypeError: ThrottlerStorageRedisService is not a constructor
CommonJS require without destructuring (wrong import)
fix
Use const { ThrottlerStorageRedisService } = require('nest-throttler-storage-redis')
Error: The "path" argument must be of type string. Received undefined
Missing redis client or incorrect Redis connection options
fix
Ensure redis package is installed and passed valid options (socket.host, socket.port)
Nest cannot find ThrottlerStorageRedisService (appears in providers but not exported)
Import path incorrect or package not exporting correctly
fix
Verify import: import { ThrottlerStorageRedisService } from 'nest-throttler-storage-redis'
Upgrade
Version history
0.0.1latest on npm
Audit
Dependencies
redisrequiredPeer dependency for Redis client required at runtime
@nestjs/throttlerrequiredPeer dependency for ThrottlerModule and ThrottlerGuard
Agent activity
2 hits · last 30 days
node
2
Resources
nest-throttler-storage-redis — npm install nest-throttler-storage-redis · libregistry