Skip to content

fix(dev): respect NO_COLOR for colored status output#365

Open
Hashim1999164 wants to merge 1 commit into
expressjs:masterfrom
Hashim1999164:fix/dev-format-respect-no-color
Open

fix(dev): respect NO_COLOR for colored status output#365
Hashim1999164 wants to merge 1 commit into
expressjs:masterfrom
Hashim1999164:fix/dev-format-respect-no-color

Conversation

@Hashim1999164

@Hashim1999164 Hashim1999164 commented Jul 22, 2026

Copy link
Copy Markdown

Summary

  • Disable ANSI colors in the dev format when NO_COLOR is set (https://no-color.org/)
  • Document the behavior in the README
  • Add a regression test for NO_COLOR=1

Closes #302

Test plan

  • npm test (Node 20): 89 passing
  • Confirm morgan('dev') still colors status codes when NO_COLOR is unset
  • Confirm morgan('dev') emits no ANSI sequences when NO_COLOR=1

Disable ANSI colors in the dev format when NO_COLOR is set, matching
https://no-color.org/. Documents the behavior and adds a regression test.

Closes expressjs#302
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.

morgan('dev') does not respect NO_COLOR=1 environment variable

1 participant