1.2.0 • Published 9 months ago

@eddaic/nestjs-cacheable v1.2.0

Weekly downloads
-
License
ISC
Repository
github
Last release
9 months ago

nestjs-cacheable

Simple NestJS Module to add DNS cache using szmarczak/cacheable-lookup.

Installation

npm install @eddaic/nestjs-cacheable

Usage

import { CacheableModule, CacheableService } from '@eddaic/nestjs-cacheable';
import { HttpModule } from '@nestjs/axios';
import { Module } from '@nestjs/common';
import { ConfigModule, ConfigService } from '@nestjs/config';

@Module({
  imports: [
    HttpModule.registerAsync({
      imports: [CacheableModule, ConfigModule],
      inject: [CacheableService, ConfigService],
      useFactory: (cacheable: CacheableService, config: ConfigService) => ({
        baseURL: config.get('MY_URL'),
        lookup: cacheable.lookup(),
      }),
    }),
  ],
  providers: [AppService],
})
export class AppModule {}
1.2.0

9 months ago

1.1.0

9 months ago

1.0.1

10 months ago

1.0.0

10 months ago