0.0.11 • Published 2 years ago

nestjs-node-cache v0.0.11

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Nestjs Node Cache

$ npm i nestjs-node-cache

Usage


    import { CacheModule } from 'nestjs-node-cache';

    @Module({
      imports: [CacheModule],
      providers: [],
      exports: [],
    })
    export class YourModule {}
  import { ICacheService } from 'nestjs-node-cache'
  
  @Injectable()
  export class YourService {
    constructor(private readonly cacheService: ICacheService) {}

      async method(): string {
        this.cacheService.set('KEY', 'textCached');

        return this.cacheService.get('KEY')
      }
  }

operators

  nodeCache: NodeCache
  connect(config?: NodeCache.Options): CacheService
  set(key: string | number, model: unknown): boolean
  mSet(model: CacheType[]): boolean
  mGet(key: string[]): unknown | null
  has(key: string | number): boolean
  del(key: string | number): boolean
  get(key: string | number): unknown
  setExpiration(key: string | number, ttl: number): boolean
  setOptions(options: NodeCache.Options): void

The following is a list of all the people that have contributed to nestjs-node-cache. Thanks for your contributions!

License

It is available under the MIT license. License

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago