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
By default, `config` will look for a file called .env in the current working directory.
388
-
389
-
Pass in multiple files as an array, and they will be parsed in order and combined with `process.env` (or `option.processEnv`, if set). The first value set for a variable will win, unless the `options.override` flag is set, in which case the last value set will win. If a value already exists in `process.env` and the `options.override` flag is NOT set, no changes will be made to that value.
Override any environment variables that have already been set on your machine with values from your .env file(s). If multiple files have been provided in `option.path` the override will also be used as each file is combined with the next. Without `override` being set, the first value wins. With `override` set the last value wins.
443
-
444
-
```js
445
-
require('dotenv').config({ override:true })
446
-
```
447
-
448
-
##### processEnv
449
-
450
-
Default: `process.env`
451
-
452
-
Specify an object to write your environment variables to. Defaults to `process.env` environment variables.
Turn on logging to help debug why certain keys or values are not being set as you expect.
482
-
483
-
```js
484
-
constdotenv=require('dotenv')
485
-
constbuf=Buffer.from('hello world')
486
-
constopt= { debug:true }
487
-
constconfig=dotenv.parse(buf, opt)
488
-
// expect a debug message because the buffer is not in KEY=VAL form
489
-
```
490
-
491
-
### Populate
492
-
493
-
The engine which populates the contents of your .env file to `process.env` is available for use. It accepts a target, a source, and options. This is useful for power users who want to supply their own objects.
By default, `config` will look for a file called .env in the current working directory.
609
+
610
+
Pass in multiple files as an array, and they will be parsed in order and combined with `process.env` (or `option.processEnv`, if set). The first value set for a variable will win, unless the `options.override` flag is set, in which case the last value set will win. If a value already exists in `process.env` and the `options.override` flag is NOT set, no changes will be made to that value.
Override any environment variables that have already been set on your machine with values from your .env file(s). If multiple files have been provided in `option.path` the override will also be used as each file is combined with the next. Without `override` being set, the first value wins. With `override` set the last value wins.
664
+
665
+
```js
666
+
require('dotenv').config({ override:true })
667
+
```
668
+
669
+
##### processEnv
670
+
671
+
Default: `process.env`
672
+
673
+
Specify an object to write your environment variables to. Defaults to `process.env` environment variables.
Turn on logging to help debug why certain keys or values are not being set as you expect.
703
+
704
+
```js
705
+
constdotenv=require('dotenv')
706
+
constbuf=Buffer.from('hello world')
707
+
constopt= { debug:true }
708
+
constconfig=dotenv.parse(buf, opt)
709
+
// expect a debug message because the buffer is not in KEY=VAL form
710
+
```
711
+
712
+
### Populate
713
+
714
+
The engine which populates the contents of your .env file to `process.env` is available for use. It accepts a target, a source, and options. This is useful for power users who want to supply their own objects.
0 commit comments