@xpjs/nest-redis
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

nest-redis

用法

1、引入日志模块

// app.module.ts
import { Module } from '@nestjs/common';
import { RedisModule } from '@xpjs/nest-redis';

@Module({
  imports: [
    // redis模块
    RedisModule.register({ host: '127.0.0.1', port: 6379, password: '123456', db: 0 }),
  ],
})
export class AppModule {}

日志的具体配置可查看log4js

2、在服务中使用

// service.ts
import { RedisService } from '@xpjs/nest-redis';
import { Injectable, Inject } from '@nestjs/common';

@Injectable()
export class LogTestService {
  @Inject()
  private readonly logger: RedisService;
}

Readme

Keywords

Package Sidebar

Install

npm i @xpjs/nest-redis

Weekly Downloads

2

Version

1.0.2

License

ISC

Unpacked Size

99.3 kB

Total Files

8

Last publish

Collaborators

  • mr.xing.c