nestjs-world-cup-lib
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

Description

Use ConfigurableModuleBuilder of NestJS 9 to build library in an easy way.

Installation

$ npm i nestjs-world-cup-lib

Register synchronously

@Module({
  WorldCupModule.forRoot({
    year: 1994,
    favoriteCountry: 'Brazil',
  })
})
export class AppModule {}

Register asynchronously

@Module({
  ...WorldCupModule.forRootAsync({
    imports: [ConfigModule],
    inject: [ConfigService],
    useFactory: (service: ConfigService) => ({
      year: service.get<number>('YEAR'),
      favoriteCountry: service.get<string>('FAVORITE_COUNTRY'),
    }),
  }),
})
export class AppModule {}

Readme

Keywords

none

Package Sidebar

Install

npm i nestjs-world-cup-lib

Weekly Downloads

1

Version

0.0.5

License

MIT

Unpacked Size

29.3 kB

Total Files

44

Last publish

Collaborators

  • railsstudent