Skip to content

docs: add FAQ for passing config options with ES6 imports#1008

Merged
motdotla merged 1 commit into
motdotla:masterfrom
vincent067:docs/esm-config-options
Apr 12, 2026
Merged

docs: add FAQ for passing config options with ES6 imports#1008
motdotla merged 1 commit into
motdotla:masterfrom
vincent067:docs/esm-config-options

Conversation

@vincent067

Copy link
Copy Markdown

Hi there! 👋

This PR adds a dedicated FAQ entry to address a question that keeps coming up (see #880) — how do you pass config options like quiet: true, path, or debug when using import 'dotenv/config'?

I ran into this myself a while back and noticed the README explains the ES6 hoisting pitfall really well, but doesn't explicitly walk through the practical options for passing config in ESM. Figured I'd open a small docs PR to help the next person who stumbles on it. 😊

What's added:

  • A link from the ES6 usage section pointing to the new FAQ
  • A new FAQ: 'How do I specify config options with ES6 import?'
  • 3 common approaches with code examples
  • A quick reference table for config options

Hope this is helpful! Happy to tweak wording or formatting if anything looks off.

Closes #880

Adds a dedicated FAQ entry explaining how to pass config options when
using ES6 imports. This comes up a lot (motdotla#880) and the current README
covers the hoisting pitfall well, but doesn't explicitly show the
practical workarounds for passing options like `quiet: true`.

Changes:
- Link from the ES6 section to the new FAQ
- Add 'How do I specify config options with ES6 import?' FAQ
- 3 common approaches with code examples
- Quick reference table for config options

Closes motdotla#880
@motdotla motdotla merged commit 8197a16 into motdotla:master Apr 12, 2026
5 checks passed
@motdotla

Copy link
Copy Markdown
Owner

Thank you!

@codecov

codecov Bot commented Apr 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (48aa216) to head (b915319).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #1008   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines          468       468           
=========================================
  Hits           468       468           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How do we specify quiet: true when importing dotenv when using ES6?

2 participants