You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You may also load the `.env` files from the command line. Add in the require `dotenv-extended/config` along with any of the options that the `load` method takes prefixed with `dotenv_config_`. e.g.:
### Configure via Environment Variables (New in 2.8.0)
157
159
158
-
The function always returns an object containing the variables loaded from the `.env` and `.env.defaults` files. The returned object does not contain the properties held in `process.env`but rather only the ones that are loaded from the `.env` and `.env.defaults` files.
160
+
You may also set the configuration values via environment variables loaded from `process.env`shown below with defaults:
159
161
160
162
```
161
-
var myConfig = require('dotenv-extended').load();
163
+
DOTENV_CONFIG_ENCODING=utf8
164
+
DOTENV_CONFIG_SILENT=true
165
+
DOTENV_CONFIG_PATH=.env
166
+
DOTENV_CONFIG_DEFAULTS=.env.defaults
167
+
DOTENV_CONFIG_SCHEMA=.env.schema
168
+
DOTENV_CONFIG_ERROR_ON_MISSING=false
169
+
DOTENV_CONFIG_ERROR_ON_EXTRA=false
170
+
DOTENV_CONFIG_ERROR_ON_REGEX=false
171
+
DOTENV_CONFIG_INCLUDE_PROCESS_ENV=false
172
+
DOTENV_CONFIG_ASSIGN_TO_PROCESS_ENV=true
173
+
DOTENV_CONFIG_OVERRIDE_PROCESS_ENV=false
174
+
```
175
+
176
+
The `load()` function always returns an object containing the variables loaded from the `.env` and `.env.defaults` files. By default the returned object does not contain the properties held in `process.env` but rather only the ones that are loaded from the `.env` and `.env.defaults` files.
0 commit comments