Registry / database / nestjs-redis-connector

nestjs-redis-connector

JSON →
library1.0.4jsnpmunverified

NestJS Redis Connector is a library that integrates Redis caching into NestJS applications. Version 1.0.4 provides a `RedisConnectorModule` for easy registration and a `RedisClientService` for interacting with Redis. It is based on ioredis and the official NestJS cache-manager module. Development appears inactive with no recent updates. Key differentiators include simple registration and out-of-the-box TypeScript support, but note the package is not widely adopted and may lack community support.

npm install nestjs-redis-connector
INSTALL
IMPORT
SIG · NESTJS-REDIS-CONNE
N
nestjs-redis-connector
databasejavascriptv1.0.4
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.

RedisConnectorModule
import { RedisConnectorModule } from 'nestjs-redis-connector'
const RedisConnectorModule = require('nestjs-redis-connector').RedisConnectorModule
Default CJS require works but TypeScript ESM is recommended.
RedisClientService
import { RedisClientService } from 'nestjs-redis-connector'
import RedisClientService from 'nestjs-redis-connector'
Named export, not default.
IRedisConnectorOptions
import { IRedisConnectorOptions } from 'nestjs-redis-connector'
TypeScript interface for configuration options.

Shows how to register RedisConnectorModule and use RedisClientService in a NestJS controller to get cached values.

// Install: npm install nestjs-redis-connector // app.module.ts import { Module } from '@nestjs/common'; import { RedisConnectorModule } from 'nestjs-redis-connector'; @Module({ imports: [ RedisConnectorModule.register({ url: process.env.REDIS_URL ?? 'redis://localhost:6379', ttl: 0, }), ], }) export class AppModule {} // cache.controller.ts import { Controller, Get, Param } from '@nestjs/common'; import { RedisClientService } from 'nestjs-redis-connector'; @Controller('cache') export class CacheController { constructor(private readonly redisClient: RedisClientService) {} @Get(':key') async getCacheValue(@Param('key') key: string): Promise<string | null> { return this.redisClient.getValue(key); } }
Debug
Known issues
gotchaThe package version 1.0.4 is recent (published 2024) but has very few downloads and no active maintenance; use with caution in production.
fix
Consider using the official @nestjs/cache-manager or cache-manager-redis-store instead.
affects: >=1.0.0
deprecatedThe method `getValue` may be renamed or removed in future versions; check documentation for updates.
fix
Use `get` or `getAsync` if available, or consult latest docs.
affects: 1.0.4
gotchaMissing `@nestjs/cache-manager` peer dependency causes runtime errors when importing the module.
fix
Run `npm install @nestjs/cache-manager@^2.1.0` alongside the package.
affects: >=1.0.0
gotchaThe package does not export any Redis client instance directly; you must use RedisClientService.
fix
Inject RedisClientService instead of trying to import a client.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module '@nestjs/cache-manager'
Missing peer dependency @nestjs/cache-manager
fix
npm install @nestjs/cache-manager@^2.1.0
RedisConnectorModule has no method 'register'
Incorrect import or older version of the package
fix
Ensure you are using version 1.0.4 and import { RedisConnectorModule } from 'nestjs-redis-connector'
Property 'getValue' does not exist on type 'RedisClientService'
TypeScript type definitions missing or outdated
fix
Update the package to latest version or manually declare type: (this.redisClient as any).getValue(key)
Upgrade
Version history
1.0.4latest on npm
Audit
Dependencies
@nestjs/cache-managerrequiredPeer dependency required for NestJS caching integration
@nestjs/commonrequiredPeer dependency required for NestJS module and service decorators
ioredisrequiredPeer dependency: underlying Redis client
Agent activity
2 hits · last 30 days
node
2
Resources
nestjs-redis-connector — npm install nestjs-redis-connector · libregistry