@betsys-nestjs/config-utils
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

Config Utils library

Library for validating config agains Joi schema before registering it.

Dependencies

Package Version
@hapi/joi ^17.0.0
@nestjs/common ^10.0.0
@nestjs/config ^3.0.0
reflect-metadata <1.0.0
rxjs ^7.0.0

Usage

Use provided function createFeatureConfig instead of original reagisterAs factory function. The rest stays the same as before ( see @nestjs/config docs for more).

import {createFeatureConfig} from '@betsys/nestjs-config-utils';
import {ConfigModule} from '@nestjs/config';

export const featureConfig = createFeatureConfig(
    'featureName',
    configObjectFactory,
    configJoiSchema,
);

@Module({
    imports: [ConfigModule.forFeature(featureConfig)],
})
class AppModule {
}

Readme

Keywords

none

Package Sidebar

Install

npm i @betsys-nestjs/config-utils

Weekly Downloads

20

Version

2.0.0

License

MIT

Unpacked Size

2.82 kB

Total Files

5

Last publish

Collaborators

  • betsys-development
  • pawelnowak1
  • andrejsoucek
  • jammie88
  • jiraspe2
  • jakubschneller
  • javor454
  • krizacekcz
  • flyrell