Skip to content

herowio/redisk-nestjs

 
 

Repository files navigation

Redisk for Nestjs

npm version

Module for using Redisk in NestJS.

Getting started

npm install redisk-nestjs redisk --save

Usage

import { Module } from '@nestjs/common';
import { RediskModule } from 'redisk-nestjs';

@Module({
  imports: [
    RediskModule.forRoot({
      host: '127.0.0.1',
      port:6379, 
      db:0
    }),
  ],
})
export class AppModule {}

Example

import { Controller, Get } from '@nestjs/common';
import { Redisk } from 'redisk';

@Controller('cats')
export class CatsController {
  constructor(private readonly redisk: Redisk) {}

  @Get()
  async findAll(): Promise<Cat[]> {
    return this.redisk.list<Cat>(Cat);
  }
}

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 79.9%
  • JavaScript 20.1%