lukeed / sirv

An optimized middleware & CLI application for serving static files~!
MIT License
1.07k stars 58 forks source link

feat: support NO_COLOR by updating kleur #108

Closed Venefilyn closed 2 years ago

Venefilyn commented 3 years ago

Some terminals do not support colors and will output a bunch of unnecessary clutter instead. kleur as of v4.1.0 support NO_COLOR var which disables color completely

lukeed commented 3 years ago

This is already possible via NO_COLOR environment variable, which is far more standardized. And some of these terminals set that ENV automatically

Venefilyn commented 3 years ago

Ah interesting, didn't know about that. Though it doesn't work

Got an npm start script with

sirv dist --cors --etag --single --host --port 8080

and running it with the NO_COLOR doesn't change anything. Still outputs color

$ NO_COLOR=true npm start
Venefilyn commented 3 years ago

@lukeed Ah, kleur was outdated. Updated it to the latest version in the latest commit and changed the PR. From what I understand changing it from v3 to v4 shouldn't affect this repo

Venefilyn commented 3 years ago

Hi @lukeed, wondering if you have time to look at this soon

lukeed commented 3 years ago

Hey, thanks. This is actually a breaking change because of the exports map within kleur@4.x I'll merge this after the next round of changes for sirv too, which will also include other breaking changes