@nestjs-redisx/core
v1.0.2
Published
Core module with driver abstraction and plugin system for NestJS RedisX
Readme
@nestjs-redisx/core
Core module for NestJS RedisX. Provides RedisModule with driver abstraction, multi-client support, plugin system, and error hierarchy. This package is required by all other @nestjs-redisx/* plugins.
Installation
npm install @nestjs-redisx/core ioredisQuick Example
import { Module, Injectable } from '@nestjs/common';
import { RedisModule, RedisService } from '@nestjs-redisx/core';
@Module({
imports: [
RedisModule.forRoot({
clients: { host: 'localhost', port: 6379 },
}),
],
})
export class AppModule {}
@Injectable()
export class AppService {
constructor(private readonly redis: RedisService) {}
async ping(): Promise<string> {
const client = await this.redis.getClient();
return client.ping();
}
}Documentation
Full documentation: nestjs-redisx.dev/en/reference/core/
License
MIT
