nestjs-world-cup-lib
v0.0.5
Published
Create a library that returns champion and runner-up of world cup
Downloads
13
Readme
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 {}