has-color => supports-color

This commit is contained in:
Sindre Sorhus 2014-06-14 03:49:42 +02:00
parent 90f012c793
commit 144421dc16
3 changed files with 5 additions and 5 deletions

View file

@ -1,7 +1,7 @@
'use strict'; 'use strict';
var ansiStyles = require('ansi-styles'); var ansiStyles = require('ansi-styles');
var stripAnsi = require('strip-ansi'); var stripAnsi = require('strip-ansi');
var hasColor = require('has-color'); var supportsColor = require('supports-color');
var defineProps = Object.defineProperties; var defineProps = Object.defineProperties;
var chalk = module.exports; var chalk = module.exports;
@ -55,7 +55,7 @@ defineProps(chalk, init());
chalk.styles = ansiStyles; chalk.styles = ansiStyles;
chalk.stripColor = stripAnsi; chalk.stripColor = stripAnsi;
chalk.supportsColor = hasColor; chalk.supportsColor = supportsColor;
// detect mode if not set manually // detect mode if not set manually
if (chalk.enabled === undefined) { if (chalk.enabled === undefined) {

View file

@ -41,8 +41,8 @@
], ],
"dependencies": { "dependencies": {
"ansi-styles": "^1.1.0", "ansi-styles": "^1.1.0",
"has-color": "^0.1.0", "strip-ansi": "^0.2.0",
"strip-ansi": "^0.2.0" "supports-color": "^0.2.0"
}, },
"devDependencies": { "devDependencies": {
"mocha": "*" "mocha": "*"

View file

@ -84,7 +84,7 @@ Color support is automatically detected, but you can override it.
### chalk.supportsColor ### chalk.supportsColor
Detect whether the terminal [supports color](https://github.com/sindresorhus/has-color). Detect whether the terminal [supports color](https://github.com/sindresorhus/supports-color).
Can be overridden by the user with the flags `--color` and `--no-color`. Can be overridden by the user with the flags `--color` and `--no-color`.