Comments (3)
Thanks for the suggestion.
You are welcome to make a PR if you can.
I'd be happy to have this functionality optional driven by a safe
flag upon initialisation of the ConfigModule
something like: ConfigModule.load({safe: true})
By default, I would keep it false.
From the documentation of dotenv-safe
looks, that we can use the flag allowEmptyValues
to turn on
or off
the guard.
https://www.npmjs.com/package/dotenv-safe#options
from nestjs-config.
I'll try to make a PR in the near time
from nestjs-config.
I'm agree with you, that safe
option should be optional and disabled bu default.
As for the allowEmptyValues
from dotenv-safe
, it was creating for the another purposes as far as I understand. Whet allowEmptyValues
option is true
, dotenv-save
allows to define env vars with empty values:
MY_VARIABLE=
but variable still needs to be present even with empty value. In a case when required variable doesn't exist in process.env, an error still will be thrown.
I think will be better to add additional options for dotenv-safe
to the ConfigModule.load()
method
from nestjs-config.
Related Issues (20)
- Config objects should be instanced without required config parameter
- Move to @nestjsx/config? HOT 1
- Add git-cz
- Add type for second return type when using Config.get HOT 2
- Optional use of another .env file as .env.defaults for shared variables HOT 7
- Can't work with `monorepo` mode HOT 6
- How to read .env files values? HOT 1
- @types/dotenv is no longer required to be installed by users HOT 2
- Usage in TypeORM transformer HOT 2
- Unable to app.get(ConfigService) in main.ts with node lts (12.16.0) HOT 30
- Compatibility with NestJS version 7 HOT 4
- Cannot get root/whole config HOT 2
- configService.get<T> returns string HOT 1
- Use nestjs-config out of services HOT 3
- Standalone usage
- Support nestjs v8
- Nestjs version 8 is not supported HOT 1
- configfile not being read HOT 1
- Is this still being maintained?
- Cannot use package Config with Microservice when split a service
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nestjs-config.