Skip to content

Commit 04322a6

Browse files
authored
Merge pull request #895 from andersr/add-es6-config-info-to-readme
2 parents 11acd9f + 1102cab commit 04322a6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ console.log(process.env) // remove this after you've confirmed it is working
7070
import 'dotenv/config'
7171
```
7272

73+
ES6 import if you need to set config options:
74+
75+
```javascript
76+
import dotenv from 'dotenv'
77+
78+
dotenv.config({ path: '/custom/path/to/.env' })
79+
```
80+
7381
That's it. `process.env` now has the keys and values you defined in your `.env` file:
7482

7583
```javascript

0 commit comments

Comments
 (0)