Skip to content

Conversation

@mkantor
Copy link
Owner

@mkantor mkantor commented Aug 5, 2025

It was satisfying to eliminate the only non-dev third-party dependency.

Comment on lines +29 to +32
// Warning: the global state mutation here means that we can't style text in static contexts!
// Functions like `node:util`'s `styleText` shouldn't be called from the top level of modules.
delete process.env['FORCE_COLOR']
process.env['NO_COLOR'] = 'true'
Copy link
Owner Author

@mkantor mkantor Aug 5, 2025

Choose a reason for hiding this comment

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

This feels even worse than the global state mutation I had to do for kleur, but on the upside it's more general: now --no-color will also disable styling in stack traces, console.log output, etc.

@mkantor mkantor changed the title Drop kleur dependency in favor of [node:util's styleText](https://nodejs.org/api/util.html#utilstyletextformat-text-options) Drop kleur dependency in favor of node:util's styleText Aug 5, 2025
@mkantor mkantor merged commit f93222d into main Aug 8, 2025
1 check passed
@mkantor mkantor deleted the drop-kleur branch August 8, 2025 10:16
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.

2 participants