aboutsummaryrefslogtreecommitdiff
path: root/node_modules/chalk
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/chalk')
-rw-r--r--node_modules/chalk/index.js240
-rw-r--r--node_modules/chalk/license20
-rw-r--r--node_modules/chalk/node_modules/ansi-styles/index.js65
-rw-r--r--node_modules/chalk/node_modules/ansi-styles/license21
-rw-r--r--node_modules/chalk/node_modules/ansi-styles/package.json50
-rw-r--r--node_modules/chalk/node_modules/ansi-styles/readme.md86
-rw-r--r--node_modules/chalk/node_modules/supports-color/index.js50
-rw-r--r--node_modules/chalk/node_modules/supports-color/license21
-rw-r--r--node_modules/chalk/node_modules/supports-color/package.json49
-rw-r--r--node_modules/chalk/node_modules/supports-color/readme.md36
-rw-r--r--node_modules/chalk/package.json137
-rw-r--r--node_modules/chalk/readme.md263
12 files changed, 431 insertions, 607 deletions
diff --git a/node_modules/chalk/index.js b/node_modules/chalk/index.js
index 2d85a9174..1cc5fa89a 100644
--- a/node_modules/chalk/index.js
+++ b/node_modules/chalk/index.js
@@ -1,116 +1,228 @@
'use strict';
-var escapeStringRegexp = require('escape-string-regexp');
-var ansiStyles = require('ansi-styles');
-var stripAnsi = require('strip-ansi');
-var hasAnsi = require('has-ansi');
-var supportsColor = require('supports-color');
-var defineProps = Object.defineProperties;
-var isSimpleWindowsTerm = process.platform === 'win32' && !/^xterm/i.test(process.env.TERM);
+const escapeStringRegexp = require('escape-string-regexp');
+const ansiStyles = require('ansi-styles');
+const stdoutColor = require('supports-color').stdout;
+
+const template = require('./templates.js');
+
+const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm');
+
+// `supportsColor.level` → `ansiStyles.color[name]` mapping
+const levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m'];
+
+// `color-convert` models to exclude from the Chalk API due to conflicts and such
+const skipModels = new Set(['gray']);
+
+const styles = Object.create(null);
+
+function applyOptions(obj, options) {
+ options = options || {};
+
+ // Detect level if not set manually
+ const scLevel = stdoutColor ? stdoutColor.level : 0;
+ obj.level = options.level === undefined ? scLevel : options.level;
+ obj.enabled = 'enabled' in options ? options.enabled : obj.level > 0;
+}
function Chalk(options) {
- // detect mode if not set manually
- this.enabled = !options || options.enabled === undefined ? supportsColor : options.enabled;
+ // We check for this.template here since calling `chalk.constructor()`
+ // by itself will have a `this` of a previously constructed chalk object
+ if (!this || !(this instanceof Chalk) || this.template) {
+ const chalk = {};
+ applyOptions(chalk, options);
+
+ chalk.template = function () {
+ const args = [].slice.call(arguments);
+ return chalkTag.apply(null, [chalk.template].concat(args));
+ };
+
+ Object.setPrototypeOf(chalk, Chalk.prototype);
+ Object.setPrototypeOf(chalk.template, chalk);
+
+ chalk.template.constructor = Chalk;
+
+ return chalk.template;
+ }
+
+ applyOptions(this, options);
}
-// use bright blue on Windows as the normal blue color is illegible
+// Use bright blue on Windows as the normal blue color is illegible
if (isSimpleWindowsTerm) {
- ansiStyles.blue.open = '\u001b[94m';
+ ansiStyles.blue.open = '\u001B[94m';
}
-var styles = (function () {
- var ret = {};
+for (const key of Object.keys(ansiStyles)) {
+ ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');
- Object.keys(ansiStyles).forEach(function (key) {
- ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');
+ styles[key] = {
+ get() {
+ const codes = ansiStyles[key];
+ return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, key);
+ }
+ };
+}
- ret[key] = {
- get: function () {
- return build.call(this, this._styles.concat(key));
- }
- };
- });
+styles.visible = {
+ get() {
+ return build.call(this, this._styles || [], true, 'visible');
+ }
+};
+
+ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), 'g');
+for (const model of Object.keys(ansiStyles.color.ansi)) {
+ if (skipModels.has(model)) {
+ continue;
+ }
+
+ styles[model] = {
+ get() {
+ const level = this.level;
+ return function () {
+ const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments);
+ const codes = {
+ open,
+ close: ansiStyles.color.close,
+ closeRe: ansiStyles.color.closeRe
+ };
+ return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);
+ };
+ }
+ };
+}
- return ret;
-})();
+ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), 'g');
+for (const model of Object.keys(ansiStyles.bgColor.ansi)) {
+ if (skipModels.has(model)) {
+ continue;
+ }
-var proto = defineProps(function chalk() {}, styles);
+ const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);
+ styles[bgModel] = {
+ get() {
+ const level = this.level;
+ return function () {
+ const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments);
+ const codes = {
+ open,
+ close: ansiStyles.bgColor.close,
+ closeRe: ansiStyles.bgColor.closeRe
+ };
+ return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);
+ };
+ }
+ };
+}
+
+const proto = Object.defineProperties(() => {}, styles);
-function build(_styles) {
- var builder = function () {
+function build(_styles, _empty, key) {
+ const builder = function () {
return applyStyle.apply(builder, arguments);
};
builder._styles = _styles;
- builder.enabled = this.enabled;
- // __proto__ is used because we must return a function, but there is
- // no way to create a function with a different prototype.
- /* eslint-disable no-proto */
- builder.__proto__ = proto;
+ builder._empty = _empty;
+
+ const self = this;
+
+ Object.defineProperty(builder, 'level', {
+ enumerable: true,
+ get() {
+ return self.level;
+ },
+ set(level) {
+ self.level = level;
+ }
+ });
+
+ Object.defineProperty(builder, 'enabled', {
+ enumerable: true,
+ get() {
+ return self.enabled;
+ },
+ set(enabled) {
+ self.enabled = enabled;
+ }
+ });
+
+ // See below for fix regarding invisible grey/dim combination on Windows
+ builder.hasGrey = this.hasGrey || key === 'gray' || key === 'grey';
+
+ // `__proto__` is used because we must return a function, but there is
+ // no way to create a function with a different prototype
+ builder.__proto__ = proto; // eslint-disable-line no-proto
return builder;
}
function applyStyle() {
- // support varags, but simply cast to string in case there's only one arg
- var args = arguments;
- var argsLen = args.length;
- var str = argsLen !== 0 && String(arguments[0]);
+ // Support varags, but simply cast to string in case there's only one arg
+ const args = arguments;
+ const argsLen = args.length;
+ let str = String(arguments[0]);
+
+ if (argsLen === 0) {
+ return '';
+ }
if (argsLen > 1) {
- // don't slice `arguments`, it prevents v8 optimizations
- for (var a = 1; a < argsLen; a++) {
+ // Don't slice `arguments`, it prevents V8 optimizations
+ for (let a = 1; a < argsLen; a++) {
str += ' ' + args[a];
}
}
- if (!this.enabled || !str) {
- return str;
+ if (!this.enabled || this.level <= 0 || !str) {
+ return this._empty ? '' : str;
}
- var nestedStyles = this._styles;
- var i = nestedStyles.length;
-
// Turns out that on Windows dimmed gray text becomes invisible in cmd.exe,
// see https://github.com/chalk/chalk/issues/58
// If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop.
- var originalDim = ansiStyles.dim.open;
- if (isSimpleWindowsTerm && (nestedStyles.indexOf('gray') !== -1 || nestedStyles.indexOf('grey') !== -1)) {
+ const originalDim = ansiStyles.dim.open;
+ if (isSimpleWindowsTerm && this.hasGrey) {
ansiStyles.dim.open = '';
}
- while (i--) {
- var code = ansiStyles[nestedStyles[i]];
-
+ for (const code of this._styles.slice().reverse()) {
// Replace any instances already present with a re-opening code
// otherwise only the part of the string until said closing code
// will be colored, and the rest will simply be 'plain'.
str = code.open + str.replace(code.closeRe, code.open) + code.close;
+
+ // Close the styling before a linebreak and reopen
+ // after next line to fix a bleed issue on macOS
+ // https://github.com/chalk/chalk/pull/92
+ str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`);
}
- // Reset the original 'dim' if we changed it to work around the Windows dimmed gray issue.
+ // Reset the original `dim` if we changed it to work around the Windows dimmed gray issue
ansiStyles.dim.open = originalDim;
return str;
}
-function init() {
- var ret = {};
+function chalkTag(chalk, strings) {
+ if (!Array.isArray(strings)) {
+ // If chalk() was called by itself or with a string,
+ // return the string itself as a string.
+ return [].slice.call(arguments, 1).join(' ');
+ }
- Object.keys(styles).forEach(function (name) {
- ret[name] = {
- get: function () {
- return build.call(this, [name]);
- }
- };
- });
+ const args = [].slice.call(arguments, 2);
+ const parts = [strings.raw[0]];
+
+ for (let i = 1; i < strings.length; i++) {
+ parts.push(String(args[i - 1]).replace(/[{}\\]/g, '\\$&'));
+ parts.push(String(strings.raw[i]));
+ }
- return ret;
+ return template(chalk, parts.join(''));
}
-defineProps(Chalk.prototype, init());
+Object.defineProperties(Chalk.prototype, styles);
-module.exports = new Chalk();
-module.exports.styles = ansiStyles;
-module.exports.hasColor = hasAnsi;
-module.exports.stripColor = stripAnsi;
-module.exports.supportsColor = supportsColor;
+module.exports = Chalk(); // eslint-disable-line new-cap
+module.exports.supportsColor = stdoutColor;
+module.exports.default = module.exports; // For TypeScript
diff --git a/node_modules/chalk/license b/node_modules/chalk/license
index 654d0bfe9..e7af2f771 100644
--- a/node_modules/chalk/license
+++ b/node_modules/chalk/license
@@ -1,21 +1,9 @@
-The MIT License (MIT)
+MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/chalk/node_modules/ansi-styles/index.js b/node_modules/chalk/node_modules/ansi-styles/index.js
deleted file mode 100644
index 78945278f..000000000
--- a/node_modules/chalk/node_modules/ansi-styles/index.js
+++ /dev/null
@@ -1,65 +0,0 @@
-'use strict';
-
-function assembleStyles () {
- var styles = {
- modifiers: {
- reset: [0, 0],
- bold: [1, 22], // 21 isn't widely supported and 22 does the same thing
- dim: [2, 22],
- italic: [3, 23],
- underline: [4, 24],
- inverse: [7, 27],
- hidden: [8, 28],
- strikethrough: [9, 29]
- },
- colors: {
- black: [30, 39],
- red: [31, 39],
- green: [32, 39],
- yellow: [33, 39],
- blue: [34, 39],
- magenta: [35, 39],
- cyan: [36, 39],
- white: [37, 39],
- gray: [90, 39]
- },
- bgColors: {
- bgBlack: [40, 49],
- bgRed: [41, 49],
- bgGreen: [42, 49],
- bgYellow: [43, 49],
- bgBlue: [44, 49],
- bgMagenta: [45, 49],
- bgCyan: [46, 49],
- bgWhite: [47, 49]
- }
- };
-
- // fix humans
- styles.colors.grey = styles.colors.gray;
-
- Object.keys(styles).forEach(function (groupName) {
- var group = styles[groupName];
-
- Object.keys(group).forEach(function (styleName) {
- var style = group[styleName];
-
- styles[styleName] = group[styleName] = {
- open: '\u001b[' + style[0] + 'm',
- close: '\u001b[' + style[1] + 'm'
- };
- });
-
- Object.defineProperty(styles, groupName, {
- value: group,
- enumerable: false
- });
- });
-
- return styles;
-}
-
-Object.defineProperty(module, 'exports', {
- enumerable: true,
- get: assembleStyles
-});
diff --git a/node_modules/chalk/node_modules/ansi-styles/license b/node_modules/chalk/node_modules/ansi-styles/license
deleted file mode 100644
index 654d0bfe9..000000000
--- a/node_modules/chalk/node_modules/ansi-styles/license
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/node_modules/chalk/node_modules/ansi-styles/package.json b/node_modules/chalk/node_modules/ansi-styles/package.json
deleted file mode 100644
index 78c535f74..000000000
--- a/node_modules/chalk/node_modules/ansi-styles/package.json
+++ /dev/null
@@ -1,50 +0,0 @@
-{
- "name": "ansi-styles",
- "version": "2.2.1",
- "description": "ANSI escape codes for styling strings in the terminal",
- "license": "MIT",
- "repository": "chalk/ansi-styles",
- "author": {
- "name": "Sindre Sorhus",
- "email": "sindresorhus@gmail.com",
- "url": "sindresorhus.com"
- },
- "maintainers": [
- "Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)",
- "Joshua Appelman <jappelman@xebia.com> (jbnicolai.com)"
- ],
- "engines": {
- "node": ">=0.10.0"
- },
- "scripts": {
- "test": "mocha"
- },
- "files": [
- "index.js"
- ],
- "keywords": [
- "ansi",
- "styles",
- "color",
- "colour",
- "colors",
- "terminal",
- "console",
- "cli",
- "string",
- "tty",
- "escape",
- "formatting",
- "rgb",
- "256",
- "shell",
- "xterm",
- "log",
- "logging",
- "command-line",
- "text"
- ],
- "devDependencies": {
- "mocha": "*"
- }
-}
diff --git a/node_modules/chalk/node_modules/ansi-styles/readme.md b/node_modules/chalk/node_modules/ansi-styles/readme.md
deleted file mode 100644
index 3f933f616..000000000
--- a/node_modules/chalk/node_modules/ansi-styles/readme.md
+++ /dev/null
@@ -1,86 +0,0 @@
-# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles)
-
-> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal
-
-You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings.
-
-![](screenshot.png)
-
-
-## Install
-
-```
-$ npm install --save ansi-styles
-```
-
-
-## Usage
-
-```js
-var ansi = require('ansi-styles');
-
-console.log(ansi.green.open + 'Hello world!' + ansi.green.close);
-```
-
-
-## API
-
-Each style has an `open` and `close` property.
-
-
-## Styles
-
-### Modifiers
-
-- `reset`
-- `bold`
-- `dim`
-- `italic` *(not widely supported)*
-- `underline`
-- `inverse`
-- `hidden`
-- `strikethrough` *(not widely supported)*
-
-### Colors
-
-- `black`
-- `red`
-- `green`
-- `yellow`
-- `blue`
-- `magenta`
-- `cyan`
-- `white`
-- `gray`
-
-### Background colors
-
-- `bgBlack`
-- `bgRed`
-- `bgGreen`
-- `bgYellow`
-- `bgBlue`
-- `bgMagenta`
-- `bgCyan`
-- `bgWhite`
-
-
-## Advanced usage
-
-By default you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module.
-
-- `ansi.modifiers`
-- `ansi.colors`
-- `ansi.bgColors`
-
-
-###### Example
-
-```js
-console.log(ansi.colors.green.open);
-```
-
-
-## License
-
-MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/node_modules/chalk/node_modules/supports-color/index.js b/node_modules/chalk/node_modules/supports-color/index.js
deleted file mode 100644
index 4346e272e..000000000
--- a/node_modules/chalk/node_modules/supports-color/index.js
+++ /dev/null
@@ -1,50 +0,0 @@
-'use strict';
-var argv = process.argv;
-
-var terminator = argv.indexOf('--');
-var hasFlag = function (flag) {
- flag = '--' + flag;
- var pos = argv.indexOf(flag);
- return pos !== -1 && (terminator !== -1 ? pos < terminator : true);
-};
-
-module.exports = (function () {
- if ('FORCE_COLOR' in process.env) {
- return true;
- }
-
- if (hasFlag('no-color') ||
- hasFlag('no-colors') ||
- hasFlag('color=false')) {
- return false;
- }
-
- if (hasFlag('color') ||
- hasFlag('colors') ||
- hasFlag('color=true') ||
- hasFlag('color=always')) {
- return true;
- }
-
- if (process.stdout && !process.stdout.isTTY) {
- return false;
- }
-
- if (process.platform === 'win32') {
- return true;
- }
-
- if ('COLORTERM' in process.env) {
- return true;
- }
-
- if (process.env.TERM === 'dumb') {
- return false;
- }
-
- if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) {
- return true;
- }
-
- return false;
-})();
diff --git a/node_modules/chalk/node_modules/supports-color/license b/node_modules/chalk/node_modules/supports-color/license
deleted file mode 100644
index 654d0bfe9..000000000
--- a/node_modules/chalk/node_modules/supports-color/license
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/node_modules/chalk/node_modules/supports-color/package.json b/node_modules/chalk/node_modules/supports-color/package.json
deleted file mode 100644
index 3bb77ac1b..000000000
--- a/node_modules/chalk/node_modules/supports-color/package.json
+++ /dev/null
@@ -1,49 +0,0 @@
-{
- "name": "supports-color",
- "version": "2.0.0",
- "description": "Detect whether a terminal supports color",
- "license": "MIT",
- "repository": "chalk/supports-color",
- "author": {
- "name": "Sindre Sorhus",
- "email": "sindresorhus@gmail.com",
- "url": "sindresorhus.com"
- },
- "maintainers": [
- "Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)",
- "Joshua Appelman <jappelman@xebia.com> (jbnicolai.com)"
- ],
- "engines": {
- "node": ">=0.8.0"
- },
- "scripts": {
- "test": "mocha"
- },
- "files": [
- "index.js"
- ],
- "keywords": [
- "color",
- "colour",
- "colors",
- "terminal",
- "console",
- "cli",
- "ansi",
- "styles",
- "tty",
- "rgb",
- "256",
- "shell",
- "xterm",
- "command-line",
- "support",
- "supports",
- "capability",
- "detect"
- ],
- "devDependencies": {
- "mocha": "*",
- "require-uncached": "^1.0.2"
- }
-}
diff --git a/node_modules/chalk/node_modules/supports-color/readme.md b/node_modules/chalk/node_modules/supports-color/readme.md
deleted file mode 100644
index b4761f1ec..000000000
--- a/node_modules/chalk/node_modules/supports-color/readme.md
+++ /dev/null
@@ -1,36 +0,0 @@
-# supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color)
-
-> Detect whether a terminal supports color
-
-
-## Install
-
-```
-$ npm install --save supports-color
-```
-
-
-## Usage
-
-```js
-var supportsColor = require('supports-color');
-
-if (supportsColor) {
- console.log('Terminal supports color');
-}
-```
-
-It obeys the `--color` and `--no-color` CLI flags.
-
-For situations where using `--color` is not possible, add an environment variable `FORCE_COLOR` with any value to force color. Trumps `--no-color`.
-
-
-## Related
-
-- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module
-- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
-
-
-## License
-
-MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/node_modules/chalk/package.json b/node_modules/chalk/package.json
index 2b5881e9a..089378366 100644
--- a/node_modules/chalk/package.json
+++ b/node_modules/chalk/package.json
@@ -1,70 +1,71 @@
{
- "name": "chalk",
- "version": "1.1.3",
- "description": "Terminal string styling done right. Much color.",
- "license": "MIT",
- "repository": "chalk/chalk",
- "maintainers": [
- "Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)",
- "Joshua Appelman <jappelman@xebia.com> (jbnicolai.com)",
- "JD Ballard <i.am.qix@gmail.com> (github.com/qix-)"
- ],
- "engines": {
- "node": ">=0.10.0"
- },
- "scripts": {
- "test": "xo && mocha",
- "bench": "matcha benchmark.js",
- "coverage": "nyc npm test && nyc report",
- "coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls"
- },
- "files": [
- "index.js"
- ],
- "keywords": [
- "color",
- "colour",
- "colors",
- "terminal",
- "console",
- "cli",
- "string",
- "str",
- "ansi",
- "style",
- "styles",
- "tty",
- "formatting",
- "rgb",
- "256",
- "shell",
- "xterm",
- "log",
- "logging",
- "command-line",
- "text"
- ],
- "dependencies": {
- "ansi-styles": "^2.2.1",
- "escape-string-regexp": "^1.0.2",
- "has-ansi": "^2.0.0",
- "strip-ansi": "^3.0.0",
- "supports-color": "^2.0.0"
- },
- "devDependencies": {
- "coveralls": "^2.11.2",
- "matcha": "^0.6.0",
- "mocha": "*",
- "nyc": "^3.0.0",
- "require-uncached": "^1.0.2",
- "resolve-from": "^1.0.0",
- "semver": "^4.3.3",
- "xo": "*"
- },
- "xo": {
- "envs": [
- "node",
- "mocha"
- ]
- }
+ "name": "chalk",
+ "version": "2.4.1",
+ "description": "Terminal string styling done right",
+ "license": "MIT",
+ "repository": "chalk/chalk",
+ "engines": {
+ "node": ">=4"
+ },
+ "scripts": {
+ "test": "xo && tsc --project types && flow --max-warnings=0 && nyc ava",
+ "bench": "matcha benchmark.js",
+ "coveralls": "nyc report --reporter=text-lcov | coveralls"
+ },
+ "files": [
+ "index.js",
+ "templates.js",
+ "types/index.d.ts",
+ "index.js.flow"
+ ],
+ "keywords": [
+ "color",
+ "colour",
+ "colors",
+ "terminal",
+ "console",
+ "cli",
+ "string",
+ "str",
+ "ansi",
+ "style",
+ "styles",
+ "tty",
+ "formatting",
+ "rgb",
+ "256",
+ "shell",
+ "xterm",
+ "log",
+ "logging",
+ "command-line",
+ "text"
+ ],
+ "dependencies": {
+ "ansi-styles": "^3.2.1",
+ "escape-string-regexp": "^1.0.5",
+ "supports-color": "^5.3.0"
+ },
+ "devDependencies": {
+ "ava": "*",
+ "coveralls": "^3.0.0",
+ "execa": "^0.9.0",
+ "flow-bin": "^0.68.0",
+ "import-fresh": "^2.0.0",
+ "matcha": "^0.7.0",
+ "nyc": "^11.0.2",
+ "resolve-from": "^4.0.0",
+ "typescript": "^2.5.3",
+ "xo": "*"
+ },
+ "types": "types/index.d.ts",
+ "xo": {
+ "envs": [
+ "node",
+ "mocha"
+ ],
+ "ignores": [
+ "test/_flow.js"
+ ]
+ }
}
diff --git a/node_modules/chalk/readme.md b/node_modules/chalk/readme.md
index 5cf111e35..d298e2c48 100644
--- a/node_modules/chalk/readme.md
+++ b/node_modules/chalk/readme.md
@@ -1,7 +1,7 @@
<h1 align="center">
<br>
<br>
- <img width="360" src="https://cdn.rawgit.com/chalk/chalk/19935d6484811c5e468817f846b7b3d417d7bf4a/logo.svg" alt="chalk">
+ <img width="320" src="media/logo.svg" alt="Chalk">
<br>
<br>
<br>
@@ -9,81 +9,108 @@
> Terminal string styling done right
-[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk)
-[![Coverage Status](https://coveralls.io/repos/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/r/chalk/chalk?branch=master)
-[![](http://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4)
+[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) [![Coverage Status](https://coveralls.io/repos/github/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/github/chalk/chalk?branch=master) [![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo) [![Mentioned in Awesome Node.js](https://awesome.re/mentioned-badge.svg)](https://github.com/sindresorhus/awesome-nodejs)
+### [See what's new in Chalk 2](https://github.com/chalk/chalk/releases/tag/v2.0.0)
-[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68). Although there are other ones, they either do too much or not enough.
+<img src="https://cdn.rawgit.com/chalk/ansi-styles/8261697c95bf34b6c7767e2cbe9941a851d59385/screenshot.svg" alt="" width="900">
-**Chalk is a clean and focused alternative.**
-![](https://github.com/chalk/ansi-styles/raw/master/screenshot.png)
+## Highlights
-
-## Why
-
-- Highly performant
-- Doesn't extend `String.prototype`
- Expressive API
+- Highly performant
- Ability to nest styles
-- Clean and focused
+- [256/Truecolor color support](#256-and-truecolor-color-support)
- Auto-detects color support
+- Doesn't extend `String.prototype`
+- Clean and focused
- Actively maintained
-- [Used by ~4500 modules](https://www.npmjs.com/browse/depended/chalk) as of July 15, 2015
+- [Used by ~23,000 packages](https://www.npmjs.com/browse/depended/chalk) as of December 31, 2017
## Install
+```console
+$ npm install chalk
```
-$ npm install --save chalk
-```
+
+<a href="https://www.patreon.com/sindresorhus">
+ <img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" width="160">
+</a>
## Usage
+```js
+const chalk = require('chalk');
+
+console.log(chalk.blue('Hello world!'));
+```
+
Chalk comes with an easy to use composable API where you just chain and nest the styles you want.
```js
-var chalk = require('chalk');
-
-// style a string
-chalk.blue('Hello world!');
+const chalk = require('chalk');
+const log = console.log;
-// combine styled and normal strings
-chalk.blue('Hello') + 'World' + chalk.red('!');
+// Combine styled and normal strings
+log(chalk.blue('Hello') + ' World' + chalk.red('!'));
-// compose multiple styles using the chainable API
-chalk.blue.bgRed.bold('Hello world!');
+// Compose multiple styles using the chainable API
+log(chalk.blue.bgRed.bold('Hello world!'));
-// pass in multiple arguments
-chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz');
+// Pass in multiple arguments
+log(chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz'));
-// nest styles
-chalk.red('Hello', chalk.underline.bgBlue('world') + '!');
+// Nest styles
+log(chalk.red('Hello', chalk.underline.bgBlue('world') + '!'));
-// nest styles of the same type even (color, underline, background)
-chalk.green(
+// Nest styles of the same type even (color, underline, background)
+log(chalk.green(
'I am a green line ' +
chalk.blue.underline.bold('with a blue substring') +
' that becomes green again!'
-);
+));
+
+// ES2015 template literal
+log(`
+CPU: ${chalk.red('90%')}
+RAM: ${chalk.green('40%')}
+DISK: ${chalk.yellow('70%')}
+`);
+
+// ES2015 tagged template literal
+log(chalk`
+CPU: {red ${cpu.totalPercent}%}
+RAM: {green ${ram.used / ram.total * 100}%}
+DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%}
+`);
+
+// Use RGB colors in terminal emulators that support it.
+log(chalk.keyword('orange')('Yay for orange colored text!'));
+log(chalk.rgb(123, 45, 67).underline('Underlined reddish color'));
+log(chalk.hex('#DEADED').bold('Bold gray!'));
```
-Easily define your own themes.
+Easily define your own themes:
```js
-var chalk = require('chalk');
-var error = chalk.bold.red;
+const chalk = require('chalk');
+
+const error = chalk.bold.red;
+const warning = chalk.keyword('orange');
+
console.log(error('Error!'));
+console.log(warning('Warning!'));
```
-Take advantage of console.log [string substitution](http://nodejs.org/docs/latest/api/console.html#console_console_log_data).
+Take advantage of console.log [string substitution](https://nodejs.org/docs/latest/api/console.html#console_console_log_data_args):
```js
-var name = 'Sindre';
+const name = 'Sindre';
console.log(chalk.green('Hello %s'), name);
-//=> Hello Sindre
+//=> 'Hello Sindre'
```
@@ -93,61 +120,46 @@ console.log(chalk.green('Hello %s'), name);
Example: `chalk.red.bold.underline('Hello', 'world');`
-Chain [styles](#styles) and call the last one as a method with a string argument. Order doesn't matter, and later styles take precedent in case of a conflict. This simply means that `Chalk.red.yellow.green` is equivalent to `Chalk.green`.
+Chain [styles](#styles) and call the last one as a method with a string argument. Order doesn't matter, and later styles take precedent in case of a conflict. This simply means that `chalk.red.yellow.green` is equivalent to `chalk.green`.
Multiple arguments will be separated by space.
### chalk.enabled
-Color support is automatically detected, but you can override it by setting the `enabled` property. You should however only do this in your own code as it applies globally to all chalk consumers.
+Color support is automatically detected, as is the level (see `chalk.level`). However, if you'd like to simply enable/disable Chalk, you can do so via the `.enabled` property.
-If you need to change this in a reusable module create a new instance:
+Chalk is enabled by default unless explicitly disabled via the constructor or `chalk.level` is `0`.
+
+If you need to change this in a reusable module, create a new instance:
```js
-var ctx = new chalk.constructor({enabled: false});
+const ctx = new chalk.constructor({enabled: false});
```
-### chalk.supportsColor
-
-Detect whether the terminal [supports color](https://github.com/chalk/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`. 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
+### chalk.level
-Exposes the styles as [ANSI escape codes](https://github.com/chalk/ansi-styles).
+Color support is automatically detected, but you can override it by setting the `level` property. You should however only do this in your own code as it applies globally to all Chalk consumers.
-Generally not useful, but you might need just the `.open` or `.close` escape code if you're mixing externally styled strings with your own.
+If you need to change this in a reusable module, create a new instance:
```js
-var chalk = require('chalk');
-
-console.log(chalk.styles.red);
-//=> {open: '\u001b[31m', close: '\u001b[39m'}
-
-console.log(chalk.styles.red.open + 'Hello' + chalk.styles.red.close);
+const ctx = new chalk.constructor({level: 0});
```
-### chalk.hasColor(string)
+Levels are as follows:
-Check whether a string [has color](https://github.com/chalk/has-ansi).
+0. All colors disabled
+1. Basic color support (16 colors)
+2. 256 color support
+3. Truecolor support (16 million colors)
-### chalk.stripColor(string)
-
-[Strip color](https://github.com/chalk/strip-ansi) from a string.
+### chalk.supportsColor
-Can be useful in combination with `.supportsColor` to strip color on externally styled text when it's not supported.
+Detect whether the terminal [supports color](https://github.com/chalk/supports-color). Used internally and handled for you, but exposed for convenience.
-Example:
+Can be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, add the environment variable `FORCE_COLOR=1` to forcefully enable color or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks.
-```js
-var chalk = require('chalk');
-var styledString = getText();
-
-if (!chalk.supportsColor) {
- styledString = chalk.stripColor(styledString);
-}
-```
+Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively.
## Styles
@@ -157,11 +169,12 @@ if (!chalk.supportsColor) {
- `reset`
- `bold`
- `dim`
-- `italic` *(not widely supported)*
+- `italic` *(Not widely supported)*
- `underline`
- `inverse`
- `hidden`
-- `strikethrough` *(not widely supported)*
+- `strikethrough` *(Not widely supported)*
+- `visible` (Text is emitted only if enabled)
### Colors
@@ -169,11 +182,18 @@ if (!chalk.supportsColor) {
- `red`
- `green`
- `yellow`
-- `blue` *(on Windows the bright version is used as normal blue is illegible)*
+- `blue` *(On Windows the bright version is used since normal blue is illegible)*
- `magenta`
- `cyan`
- `white`
-- `gray`
+- `gray` ("bright black")
+- `redBright`
+- `greenBright`
+- `yellowBright`
+- `blueBright`
+- `magentaBright`
+- `cyanBright`
+- `whiteBright`
### Background colors
@@ -185,29 +205,110 @@ if (!chalk.supportsColor) {
- `bgMagenta`
- `bgCyan`
- `bgWhite`
+- `bgBlackBright`
+- `bgRedBright`
+- `bgGreenBright`
+- `bgYellowBright`
+- `bgBlueBright`
+- `bgMagentaBright`
+- `bgCyanBright`
+- `bgWhiteBright`
+
+
+## Tagged template literal
+
+Chalk can be used as a [tagged template literal](http://exploringjs.com/es6/ch_template-literals.html#_tagged-template-literals).
+
+```js
+const chalk = require('chalk');
+
+const miles = 18;
+const calculateFeet = miles => miles * 5280;
+
+console.log(chalk`
+ There are {bold 5280 feet} in a mile.
+ In {bold ${miles} miles}, there are {green.bold ${calculateFeet(miles)} feet}.
+`);
+```
+
+Blocks are delimited by an opening curly brace (`{`), a style, some content, and a closing curly brace (`}`).
+
+Template styles are chained exactly like normal Chalk styles. The following two statements are equivalent:
+
+```js
+console.log(chalk.bold.rgb(10, 100, 200)('Hello!'));
+console.log(chalk`{bold.rgb(10,100,200) Hello!}`);
+```
+
+Note that function styles (`rgb()`, `hsl()`, `keyword()`, etc.) may not contain spaces between parameters.
+All interpolated values (`` chalk`${foo}` ``) are converted to strings via the `.toString()` method. All curly braces (`{` and `}`) in interpolated value strings are escaped.
-## 256-colors
-Chalk does not support anything other than the base eight colors, which guarantees it will work on all terminals and systems. Some terminals, specifically `xterm` compliant ones, will support the full range of 8-bit colors. For this the lower level [ansi-256-colors](https://github.com/jbnicolai/ansi-256-colors) package can be used.
+## 256 and Truecolor color support
+
+Chalk supports 256 colors and [Truecolor](https://gist.github.com/XVilka/8346728) (16 million colors) on supported terminal apps.
+
+Colors are downsampled from 16 million RGB values to an ANSI color format that is supported by the terminal emulator (or by specifying `{level: n}` as a Chalk option). For example, Chalk configured to run at level 1 (basic color support) will downsample an RGB value of #FF0000 (red) to 31 (ANSI escape for red).
+
+Examples:
+
+- `chalk.hex('#DEADED').underline('Hello, world!')`
+- `chalk.keyword('orange')('Some orange text')`
+- `chalk.rgb(15, 100, 204).inverse('Hello!')`
+
+Background versions of these models are prefixed with `bg` and the first level of the module capitalized (e.g. `keyword` for foreground colors and `bgKeyword` for background colors).
+
+- `chalk.bgHex('#DEADED').underline('Hello, world!')`
+- `chalk.bgKeyword('orange')('Some orange text')`
+- `chalk.bgRgb(15, 100, 204).inverse('Hello!')`
+
+The following color models can be used:
+
+- [`rgb`](https://en.wikipedia.org/wiki/RGB_color_model) - Example: `chalk.rgb(255, 136, 0).bold('Orange!')`
+- [`hex`](https://en.wikipedia.org/wiki/Web_colors#Hex_triplet) - Example: `chalk.hex('#FF8800').bold('Orange!')`
+- [`keyword`](https://www.w3.org/wiki/CSS/Properties/color/keywords) (CSS keywords) - Example: `chalk.keyword('orange').bold('Orange!')`
+- [`hsl`](https://en.wikipedia.org/wiki/HSL_and_HSV) - Example: `chalk.hsl(32, 100, 50).bold('Orange!')`
+- [`hsv`](https://en.wikipedia.org/wiki/HSL_and_HSV) - Example: `chalk.hsv(32, 100, 100).bold('Orange!')`
+- [`hwb`](https://en.wikipedia.org/wiki/HWB_color_model) - Example: `chalk.hwb(32, 0, 50).bold('Orange!')`
+- `ansi16`
+- `ansi256`
## Windows
-If you're on Windows, do yourself a favor and use [`cmder`](http://bliker.github.io/cmder/) instead of `cmd.exe`.
+If you're on Windows, do yourself a favor and use [`cmder`](http://cmder.net/) instead of `cmd.exe`.
+
+
+## Origin story
+
+[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68) and the package is unmaintained. Although there are other packages, they either do too much or not enough. Chalk is a clean and focused alternative.
## Related
- [chalk-cli](https://github.com/chalk/chalk-cli) - CLI for this module
-- [ansi-styles](https://github.com/chalk/ansi-styles/) - ANSI escape codes for styling strings in the terminal
-- [supports-color](https://github.com/chalk/supports-color/) - Detect whether a terminal supports color
+- [ansi-styles](https://github.com/chalk/ansi-styles) - ANSI escape codes for styling strings in the terminal
+- [supports-color](https://github.com/chalk/supports-color) - Detect whether a terminal supports color
- [strip-ansi](https://github.com/chalk/strip-ansi) - Strip ANSI escape codes
+- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Strip ANSI escape codes from a stream
- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes
- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes
- [wrap-ansi](https://github.com/chalk/wrap-ansi) - Wordwrap a string with ANSI escape codes
+- [slice-ansi](https://github.com/chalk/slice-ansi) - Slice a string with ANSI escape codes
+- [color-convert](https://github.com/qix-/color-convert) - Converts colors between different models
+- [chalk-animation](https://github.com/bokub/chalk-animation) - Animate strings in the terminal
+- [gradient-string](https://github.com/bokub/gradient-string) - Apply color gradients to strings
+- [chalk-pipe](https://github.com/LitoMore/chalk-pipe) - Create chalk style schemes with simpler style strings
+- [terminal-link](https://github.com/sindresorhus/terminal-link) - Create clickable links in the terminal
+
+
+## Maintainers
+
+- [Sindre Sorhus](https://github.com/sindresorhus)
+- [Josh Junon](https://github.com/qix-)
## License
-MIT © [Sindre Sorhus](http://sindresorhus.com)
+MIT