Skip to content

Conversation

@MaddyGuthridge
Copy link

@MaddyGuthridge MaddyGuthridge commented May 29, 2025

Resolves #302

This is a quick fix, rather than a major change to the system Morgan uses for styled console output. In an ideal world, using NO_COLOR would disable all styling of output, which would remove the presence of control characters in things like CI logs. Currently, this PR just sets the color to 0 if NO_COLOR is set in process.env, which is acceptable for accessibility.

As a side note: I'm not used to writing code for such old versions of Node, so apologies if I made any mistakes that break that compatibility. I tried testing using Node 0.8.28, but was unable to get npm i to work correctly. Let me know if I broke anything and I'll do my best to fix it up :)

  • Implementation
  • Test suite passes with 100% coverage
  • Linting passes with no errors or warnings

I accept the certificate of origin, and am happy for my contribution to use the project's MIT software license.

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