add support for FORCE_COLOR environment variable to force color

https://github.com/sindresorhus/supports-color/pull/18
This commit is contained in:
Sindre Sorhus 2015-02-23 14:03:03 +07:00
parent e520cec3e1
commit 19935d6484
2 changed files with 3 additions and 5 deletions

View file

@ -44,7 +44,7 @@
"escape-string-regexp": "^1.0.2",
"has-ansi": "^1.0.3",
"strip-ansi": "^2.0.1",
"supports-color": "^1.2.1"
"supports-color": "^1.3.0"
},
"devDependencies": {
"matcha": "^0.6.0",

View file

@ -99,11 +99,9 @@ var ctx = new chalk.constructor({enabled: false});
### chalk.supportsColor
Detect whether the terminal [supports color](https://github.com/sindresorhus/supports-color).
Detect whether the terminal [supports color](https://github.com/sindresorhus/supports-color). Used internally and handled for you, but exposed for convenience.
Can be overridden by the user with the flags `--color` and `--no-color`.
Used internally and handled for you, but exposed for convenience.
Can be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, add an environment variable `FORCE_COLOR` with any value to force color. Trumps `--no-color`.
### chalk.styles