parent
77ae94f63a
commit
a66c486301
2 changed files with 6 additions and 7 deletions
10
chalk.js
10
chalk.js
|
|
@ -1,5 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
var ansi = require('ansi-styles');
|
var ansi = require('ansi-styles');
|
||||||
|
var stripAnsi = require('strip-ansi');
|
||||||
|
var hasColor = require('has-color');
|
||||||
var defineProps = Object.defineProperties;
|
var defineProps = Object.defineProperties;
|
||||||
|
|
||||||
ansi.grey = ansi.gray;
|
ansi.grey = ansi.gray;
|
||||||
|
|
@ -51,12 +53,8 @@ function init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
chalk.styles = ansi;
|
chalk.styles = ansi;
|
||||||
|
chalk.stripColor = stripAnsi;
|
||||||
chalk.stripColor = function (str) {
|
chalk.supportsColor = hasColor;
|
||||||
return typeof str === 'string' ? str.replace(/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]/g, '') : str;
|
|
||||||
};
|
|
||||||
|
|
||||||
chalk.supportsColor = require('has-color');
|
|
||||||
|
|
||||||
// detect mode if not set manually
|
// detect mode if not set manually
|
||||||
if (chalk.enabled === undefined) {
|
if (chalk.enabled === undefined) {
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,8 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"has-color": "~0.1.0",
|
"has-color": "~0.1.0",
|
||||||
"ansi-styles": "~0.2.0"
|
"ansi-styles": "~0.2.0",
|
||||||
|
"strip-ansi": "~0.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"mocha": "~1.12.0"
|
"mocha": "~1.12.0"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue