chalk/supports-color



The issue has been solved
Make flag sniffing optional #40
bolinfest posted onGitHub
Although the heuristics for inspecting process.argv
via hasFlag()
are pretty reasonable, they are by no means foolproof and can lead to false positives and negatives. It would be nice if it were possible to use the functionality of supportLevel()
without any of the hasFlag()
logic. I believe the remaining logic would be a function of:
process.env.CI
process.env.TEAMCITY_VERSION
process.env. COLORTERM
process.env.TERM
process.stdout
process.platform
It would be even more flexible if it were possible to pass in the process
object so that it could be mocked and/or used from another process.