File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,8 @@ console.log(process.env) // remove this after you've confirmed it working
43
43
.. or using ES6?
44
44
45
45
``` javascript
46
- import ' dotenv/config' // see https://github.com/motdotla/dotenv#how-do-i-use-dotenv-with-import
46
+ import * as dotenv from ' dotenv' // see https://github.com/motdotla/dotenv#how-do-i-use-dotenv-with-import
47
+ dotenv .config ()
47
48
import express from ' express'
48
49
```
49
50
@@ -331,7 +332,8 @@ Simply..
331
332
332
333
``` javascript
333
334
// index.mjs (ESM)
334
- import ' dotenv/config' // see https://github.com/motdotla/dotenv#how-do-i-use-dotenv-with-import
335
+ import * as dotenv from ' dotenv' // see https://github.com/motdotla/dotenv#how-do-i-use-dotenv-with-import
336
+ dotenv .config ()
335
337
import express from ' express'
336
338
```
337
339
@@ -368,7 +370,8 @@ import { Client } from 'best-error-reporting-service'
368
370
export default new Client (process .env .API_KEY )
369
371
370
372
// index.mjs
371
- import ' dotenv/config'
373
+ import * as dotenv from ' dotenv'
374
+ dotenv .config ()
372
375
373
376
import errorReporter from ' ./errorReporter.mjs'
374
377
errorReporter .report (new Error (' documented example' ))
You can’t perform that action at this time.
0 commit comments