Extends the default dotenv-loader
and module
provided by
nest-typed-config
NPM package.
yarn add nest-typed-config-extended
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 {}
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.
MIT License
Contributions are encouraged, please see further details below:
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.