Skip to content

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

@MaddyGuthridge

Description

@MaddyGuthridge

The NO_COLOR environment variable is the widely-accepted standard for disabling colour in terminal applications. While most users (myself included) love colourful outputs, these outputs can cause significant accessibility issues for people with limited vision.

A wider explanation can be found at no-color.org

As such, Morgan should detect the use of the NO_COLOR environment variable, and disable coloured output when it is set.

Environment information

Version:

  • "morgan": "^1.10.0"
  • "express": "^4.19.2"

Platform:

Linux yzma 6.14.6-300.fc42.x86_64 #1 SMP PREEMPT_DYNAMIC Fri May 9 20:11:19 UTC 2025 x86_64 GNU/Linux

Node.js version:

v20.18.1

Any other relevant information:

What steps will reproduce the bug?

Run a server passing the environment variable NO_COLOR=1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions