Skip to content

Commit 228c7b4

Browse files
committed
Update README
1 parent f32799c commit 228c7b4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ console.log(process.env) // remove this after you've confirmed it working
4343
.. or using ES6?
4444

4545
```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()
4748
import express from 'express'
4849
```
4950

@@ -331,7 +332,8 @@ Simply..
331332

332333
```javascript
333334
// 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()
335337
import express from 'express'
336338
```
337339

@@ -368,7 +370,8 @@ import { Client } from 'best-error-reporting-service'
368370
export default new Client(process.env.API_KEY)
369371

370372
// index.mjs
371-
import 'dotenv/config'
373+
import * as dotenv from 'dotenv'
374+
dotenv.config()
372375

373376
import errorReporter from './errorReporter.mjs'
374377
errorReporter.report(new Error('documented example'))

0 commit comments

Comments
 (0)