nest-typed-config-extended
v0.0.13
Published
Extends the default dotenv-loader and module provided by nest-typed-config.
Downloads
6
Maintainers
Readme
Nest Typed Config Extended
Extends the default dotenv-loader
and module
provided by
nest-typed-config
NPM package.
Installation
yarn add nest-typed-config-extended
Usage
import { TypedConfigModuleExtended, dotenvLoaderExtended } from 'nest-typed-config-extended';
import { Config } from './common/config';
@Module({
imports: [
TypedConfigModuleExtended.forRoot({
isGlobal: true,
load: dotenvLoaderExtended({
envFilePath: ['.env'],
separator: '__',
transformFromUpperSnakeCase: true,
}),
schema: Config,
}),
],
})
export class MainModule {}
Options
transformFromUpperSnakeCase
If set to to true
an .env
file that contains UPPER_SNAKE_CASE
variables, e.g. NODE_ENV
, will
be transformed to the camelCase equivalent, e.g. nodeEnv
. This works for shallow and deeply nested
objects.
License
MIT License
Contributing
Contributions are encouraged, please see further details below:
Pull Requests
Here are some basic rules to follow to ensure timely addition of your request:
- Match coding style (braces, spacing, etc.).
- If it is a feature, bugfix, or anything please only change the minimum amount of code required to satisfy the change.
- Please keep PR titles easy to read and descriptive of changes, this will make them easier to merge.
- Pull requests must be made against the
main
branch. Any other branch (unless specified by the maintainers) will get rejected. - Check for existing issues first, before filing a new issue.