Skip to content

support passing DOTENV_CONFIG_QUIET=true (and other DOTENV_CONFIG opt… #889

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 9, 2025

Conversation

motdotla
Copy link
Owner

@motdotla motdotla commented Jul 9, 2025

…ions - see env-options.js) to modify config options, rather than via code

…ions - see env-options.js) to modify config options, rather than via code
Copy link

codecov bot commented Jul 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (13bc310) to head (e99c367).
Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #889   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines          463       473   +10     
=========================================
+ Hits           463       473   +10     

☔ 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.

@motdotla motdotla requested a review from Copilot July 9, 2025 16:10
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds support for controlling log output via DOTENV_CONFIG_QUIET (and other DOTENV_CONFIG_ flags) instead of only via code options.

  • Introduces a parseBoolean helper and uses it to read DOTENV_CONFIG_DEBUG and DOTENV_CONFIG_QUIET from both environment and .env files.
  • Updates configDotenv and _configVault to re-evaluate flags after loading files.
  • Expands tests in test-config.js for quiet/debug behavior and cleans up duplicates in test-config-vault.js.
  • Documents the new DOTENV_CONFIG_QUIET option in CHANGELOG.md.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
tests/test-config.js Globalizes logStub, adds lifecycle hooks, and covers new quiet/debug flag behaviors
tests/test-config-vault.js Removes duplicated quiet/debug tests and adds a vault-specific debug scenario
lib/main.js Introduces parseBoolean and applies it to override code options with DOTENV_CONFIG_* flags
CHANGELOG.md Bumps to 17.2.0 and details the new DOTENV_CONFIG_QUIET environment setting
Comments suppressed due to low confidence (3)

tests/test-config.js:492

  • Add a test case for process.env.DOTENV_CONFIG_DEBUG = 'false' to verify that debug logging is disabled when the flag is explicitly false.
t.test('logs if debug set', ct => {

tests/test-config-vault.js:20

  • Consider adding tests for quiet and DOTENV_CONFIG_QUIET behavior in the vault flow (_configVault) to match coverage in test-config.js.
t.afterEach(() => {

CHANGELOG.md:7

  • [nitpick] The release date for version 17.2.0 is in the future; please update to the actual release date or remove the date.
## [17.2.0](https://github.com/motdotla/dotenv/compare/v17.1.0...v17.2.0) (2025-07-09)

@motdotla motdotla merged commit 40e26e9 into master Jul 9, 2025
7 checks passed
@motdotla motdotla deleted the env-quiet branch July 9, 2025 16:22
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Aug 9, 2025
| datasource | package | from   | to     |
| ---------- | ------- | ------ | ------ |
| npm        | dotenv  | 16.6.1 | 17.2.1 |


## [v17.2.1](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1721-2025-07-24)

##### Changed

- Fix clickable tip links by removing parentheses ([#897](motdotla/dotenv#897))


## [v17.2.0](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1720-2025-07-09)

##### Added

- Optionally specify `DOTENV_CONFIG_QUIET=true` in your environment or `.env` file to quiet the runtime log ([#889](motdotla/dotenv#889))
- Just like dotenv any `DOTENV_CONFIG_` environment variables take precedence over any code set options like `({quiet: false})`

```ini
```


## [v17.1.0](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1710-2025-07-07)

##### Added

- Add additional security and configuration tips to the runtime log ([#884](motdotla/dotenv#884))
- Dim the tips text from the main injection information text

```js
const TIPS = [
  '🔐 encrypt with dotenvx: https://dotenvx.com',
  '🔐 prevent committing .env to code: https://dotenvx.com/precommit',
  '🔐 prevent building .env in docker: https://dotenvx.com/prebuild',
  '🛠️  run anywhere with `dotenvx run -- yourcommand`',
  '⚙️  specify custom .env file path with { path: \'/custom/path/.env\' }',
  '⚙️  enable debug logging with { debug: true }',
  '⚙️  override existing env vars with { override: true }',
  '⚙️  suppress all logs with { quiet: true }',
  '⚙️  write to custom object with { processEnv: myObject }',
  '⚙️  load multiple .env files with { path: [\'.env.local\', \'.env\'] }'
]
```


## [v17.0.1](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1701-2025-07-01)

##### Changed

- Patched injected log to count only populated/set keys to process.env ([#879](motdotla/dotenv#879))


## [v17.0.0](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1700-2025-06-27)

##### Changed

- Default `quiet` to false - informational (file and keys count) runtime log message shows by default ([#875](motdotla/dotenv#874))
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Aug 10, 2025
| datasource | package | from   | to     |
| ---------- | ------- | ------ | ------ |
| npm        | dotenv  | 16.6.1 | 17.2.1 |


## [v17.2.1](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1721-2025-07-24)

##### Changed

- Fix clickable tip links by removing parentheses ([#897](motdotla/dotenv#897))


## [v17.2.0](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1720-2025-07-09)

##### Added

- Optionally specify `DOTENV_CONFIG_QUIET=true` in your environment or `.env` file to quiet the runtime log ([#889](motdotla/dotenv#889))
- Just like dotenv any `DOTENV_CONFIG_` environment variables take precedence over any code set options like `({quiet: false})`

```ini
```


## [v17.1.0](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1710-2025-07-07)

##### Added

- Add additional security and configuration tips to the runtime log ([#884](motdotla/dotenv#884))
- Dim the tips text from the main injection information text

```js
const TIPS = [
  '🔐 encrypt with dotenvx: https://dotenvx.com',
  '🔐 prevent committing .env to code: https://dotenvx.com/precommit',
  '🔐 prevent building .env in docker: https://dotenvx.com/prebuild',
  '🛠️  run anywhere with `dotenvx run -- yourcommand`',
  '⚙️  specify custom .env file path with { path: \'/custom/path/.env\' }',
  '⚙️  enable debug logging with { debug: true }',
  '⚙️  override existing env vars with { override: true }',
  '⚙️  suppress all logs with { quiet: true }',
  '⚙️  write to custom object with { processEnv: myObject }',
  '⚙️  load multiple .env files with { path: [\'.env.local\', \'.env\'] }'
]
```


## [v17.0.1](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1701-2025-07-01)

##### Changed

- Patched injected log to count only populated/set keys to process.env ([#879](motdotla/dotenv#879))


## [v17.0.0](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1700-2025-06-27)

##### Changed

- Default `quiet` to false - informational (file and keys count) runtime log message shows by default ([#875](motdotla/dotenv#874))
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.

1 participant
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy