[Pkg-javascript-commits] [node-chalk] 01/03: Imported Upstream version 1.0.0
Sebastiaan Couwenberg
sebastic at moszumanska.debian.org
Fri Mar 20 20:54:19 UTC 2015
This is an automated email from the git hooks/post-receive script.
sebastic pushed a commit to branch master
in repository node-chalk.
commit 2f6a836379170105fd07004a87cd05ca4a2b16f2
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date: Fri Mar 20 20:54:36 2015 +0100
Imported Upstream version 1.0.0
---
.editorconfig | 1 -
.jshintrc | 4 --
.travis.yml | 3 +
index.js | 41 +++++++------
logo.png | Bin 25696 -> 25676 bytes
logo.svg | 2 +-
node_modules/ansi-regex/.editorconfig | 16 ------
node_modules/ansi-regex/.gitattributes | 1 -
node_modules/ansi-regex/.gitignore | 1 -
node_modules/ansi-regex/.jshintrc | 16 ------
node_modules/ansi-regex/.travis.yml | 3 -
node_modules/ansi-regex/index.js | 4 --
node_modules/ansi-regex/license | 21 -------
node_modules/ansi-regex/package.json | 51 -----------------
node_modules/ansi-regex/readme.md | 33 -----------
node_modules/ansi-regex/test.js | 19 ------
node_modules/ansi-styles/.editorconfig | 16 ------
node_modules/ansi-styles/.gitattributes | 1 -
node_modules/ansi-styles/.gitignore | 1 -
node_modules/ansi-styles/.jshintrc | 16 ------
node_modules/ansi-styles/.travis.yml | 3 -
node_modules/ansi-styles/index.js | 40 -------------
node_modules/ansi-styles/license | 21 -------
node_modules/ansi-styles/package.json | 46 ---------------
node_modules/ansi-styles/readme.md | 70 -----------------------
node_modules/ansi-styles/screenshot.png | Bin 51858 -> 0 bytes
node_modules/ansi-styles/test.js | 26 ---------
node_modules/escape-string-regexp/.editorconfig | 16 ------
node_modules/escape-string-regexp/.gitattributes | 1 -
node_modules/escape-string-regexp/.gitignore | 1 -
node_modules/escape-string-regexp/.jshintrc | 13 -----
node_modules/escape-string-regexp/.travis.yml | 3 -
node_modules/escape-string-regexp/index.js | 11 ----
node_modules/escape-string-regexp/license | 21 -------
node_modules/escape-string-regexp/package.json | 36 ------------
node_modules/escape-string-regexp/readme.md | 27 ---------
node_modules/escape-string-regexp/test.js | 7 ---
node_modules/has-ansi/.editorconfig | 16 ------
node_modules/has-ansi/.gitattributes | 1 -
node_modules/has-ansi/.gitignore | 1 -
node_modules/has-ansi/.jshintrc | 13 -----
node_modules/has-ansi/.travis.yml | 3 -
node_modules/has-ansi/cli.js | 53 -----------------
node_modules/has-ansi/index.js | 4 --
node_modules/has-ansi/license | 21 -------
node_modules/has-ansi/package.json | 57 ------------------
node_modules/has-ansi/readme.md | 45 ---------------
node_modules/has-ansi/test.js | 8 ---
node_modules/strip-ansi/.editorconfig | 16 ------
node_modules/strip-ansi/.gitattributes | 1 -
node_modules/strip-ansi/.gitignore | 1 -
node_modules/strip-ansi/.jshintrc | 16 ------
node_modules/strip-ansi/.travis.yml | 3 -
node_modules/strip-ansi/cli.js | 39 -------------
node_modules/strip-ansi/index.js | 6 --
node_modules/strip-ansi/license | 21 -------
node_modules/strip-ansi/package.json | 56 ------------------
node_modules/strip-ansi/readme.md | 43 --------------
node_modules/strip-ansi/test.js | 23 --------
node_modules/supports-color/.editorconfig | 16 ------
node_modules/supports-color/.gitattributes | 1 -
node_modules/supports-color/.gitignore | 1 -
node_modules/supports-color/.jshintrc | 13 -----
node_modules/supports-color/.travis.yml | 3 -
node_modules/supports-color/cli.js | 28 ---------
node_modules/supports-color/index.js | 32 -----------
node_modules/supports-color/license | 21 -------
node_modules/supports-color/package.json | 50 ----------------
node_modules/supports-color/readme.md | 44 --------------
node_modules/supports-color/test.js | 30 ----------
package.json | 18 +++---
readme.md | 68 ++++++++++++++--------
test.js | 34 ++++++-----
73 files changed, 102 insertions(+), 1296 deletions(-)
diff --git a/.editorconfig b/.editorconfig
index 8311fe1..86c8f59 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -1,4 +1,3 @@
-# editorconfig.org
root = true
[*]
diff --git a/.jshintrc b/.jshintrc
index 3e1760c..804f8af 100644
--- a/.jshintrc
+++ b/.jshintrc
@@ -4,13 +4,9 @@
"bitwise": true,
"camelcase": true,
"curly": true,
- "eqeqeq": true,
"immed": true,
- "indent": 4,
"newcap": true,
"noarg": true,
- "proto": true,
- "quotmark": "single",
"undef": true,
"unused": "vars",
"strict": true
diff --git a/.travis.yml b/.travis.yml
index 244b7e8..dedfc07 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,3 +1,6 @@
+sudo: false
language: node_js
node_js:
+ - 'iojs'
+ - '0.12'
- '0.10'
diff --git a/index.js b/index.js
index ac1f168..4138a64 100644
--- a/index.js
+++ b/index.js
@@ -5,13 +5,23 @@ var stripAnsi = require('strip-ansi');
var hasAnsi = require('has-ansi');
var supportsColor = require('supports-color');
var defineProps = Object.defineProperties;
-var chalk = module.exports;
+
+function Chalk(options) {
+ // detect mode if not set manually
+ this.enabled = !options || options.enabled === undefined ? supportsColor : options.enabled;
+}
+
+// use bright blue on Windows as the normal blue color is illegible
+if (process.platform === 'win32') {
+ ansiStyles.blue.open = '\u001b[94m';
+}
function build(_styles) {
var builder = function builder() {
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.
builder.__proto__ = proto;
@@ -21,14 +31,12 @@ function build(_styles) {
var styles = (function () {
var ret = {};
- ansiStyles.grey = ansiStyles.gray;
-
Object.keys(ansiStyles).forEach(function (key) {
ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');
ret[key] = {
get: function () {
- return build(this._styles.concat(key));
+ return build.call(this, this._styles.concat(key));
}
};
});
@@ -50,14 +58,15 @@ function applyStyle() {
}
}
- if (!chalk.enabled || !str) {
+ if (!this.enabled || !str) {
return str;
}
- /*jshint validthis: true*/
+ /*jshint validthis: true */
var nestedStyles = this._styles;
- for (var i = 0; i < nestedStyles.length; i++) {
+ var i = nestedStyles.length;
+ while (i--) {
var code = ansiStyles[nestedStyles[i]];
// Replace any instances already present with a re-opening code
// otherwise only the part of the string until said closing code
@@ -74,7 +83,7 @@ function init() {
Object.keys(styles).forEach(function (name) {
ret[name] = {
get: function () {
- return build([name]);
+ return build.call(this, [name]);
}
};
});
@@ -82,14 +91,10 @@ function init() {
return ret;
}
-defineProps(chalk, init());
-
-chalk.styles = ansiStyles;
-chalk.hasColor = hasAnsi;
-chalk.stripColor = stripAnsi;
-chalk.supportsColor = supportsColor;
+defineProps(Chalk.prototype, init());
-// detect mode if not set manually
-if (chalk.enabled === undefined) {
- chalk.enabled = chalk.supportsColor;
-}
+module.exports = new Chalk();
+module.exports.styles = ansiStyles;
+module.exports.hasColor = hasAnsi;
+module.exports.stripColor = stripAnsi;
+module.exports.supportsColor = supportsColor;
diff --git a/logo.png b/logo.png
index 1228ccf..dad5674 100644
Binary files a/logo.png and b/logo.png differ
diff --git a/logo.svg b/logo.svg
index 28d1881..fcc3ea1 100644
--- a/logo.svg
+++ b/logo.svg
@@ -1 +1 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="500" height="230"><path fill="#ED8A8A" d="M33.502 181.448l-8.538-5.679-3.547-5.125-8.936-12.332-1.314-3.881-2.496-5.811-4.861-16.065-1.71-9.146-.522-3.739-1.05-3.32v-4.852l-.528-3.738v-20.915l3.023-23.549 1.574-3.322.789-6.095 2.759-6.789 1.052-4.29 2.496-5.402 2.103-3.742 3.02-6.372 5.653-7.063 1.444-2.076 5.125-5.403 3.019-2.077 6.175-5.123 4.597-1.389 7.62-2.629h7.095l4.336-1.524 4.862 2.078 7.093.97 5.124 2.218 2.235.828 1.838 1.8v4.848l [...]
\ No newline at end of file
+<svg xmlns="http://www.w3.org/2000/svg" width="500" height="230"><path fill="#ED8A8A" d="M33.502 181.448l-8.538-5.68-3.547-5.124-8.936-12.332-1.31-3.88-2.49-5.812-4.86-16.065-1.71-9.146-.52-3.74-1.05-3.32v-4.86L0 107.76V86.845l3.023-23.55 1.574-3.32.79-6.096 2.758-6.79 1.052-4.29 2.496-5.41 2.103-3.74 3.02-6.37 5.653-7.07 1.44-2.08 5.12-5.4 3.02-2.08 6.17-5.12 4.59-1.39 7.62-2.63h7.09L61.88 0l4.862 2.078 7.093.97 5.124 2.218 2.23.828 1.84 1.8v4.848l-2.89 6.098-.92 4.57-2.37 4.982-.53 3.6 [...]
\ No newline at end of file
diff --git a/node_modules/ansi-regex/.editorconfig b/node_modules/ansi-regex/.editorconfig
deleted file mode 100644
index 8311fe1..0000000
--- a/node_modules/ansi-regex/.editorconfig
+++ /dev/null
@@ -1,16 +0,0 @@
-# editorconfig.org
-root = true
-
-[*]
-indent_style = tab
-end_of_line = lf
-charset = utf-8
-trim_trailing_whitespace = true
-insert_final_newline = true
-
-[package.json]
-indent_style = space
-indent_size = 2
-
-[*.md]
-trim_trailing_whitespace = false
diff --git a/node_modules/ansi-regex/.gitattributes b/node_modules/ansi-regex/.gitattributes
deleted file mode 100644
index 176a458..0000000
--- a/node_modules/ansi-regex/.gitattributes
+++ /dev/null
@@ -1 +0,0 @@
-* text=auto
diff --git a/node_modules/ansi-regex/.gitignore b/node_modules/ansi-regex/.gitignore
deleted file mode 100644
index 3c3629e..0000000
--- a/node_modules/ansi-regex/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-node_modules
diff --git a/node_modules/ansi-regex/.jshintrc b/node_modules/ansi-regex/.jshintrc
deleted file mode 100644
index c511975..0000000
--- a/node_modules/ansi-regex/.jshintrc
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "node": true,
- "esnext": true,
- "bitwise": true,
- "camelcase": true,
- "curly": true,
- "eqeqeq": true,
- "immed": true,
- "indent": 4,
- "newcap": true,
- "noarg": true,
- "quotmark": "single",
- "undef": true,
- "unused": "vars",
- "strict": true
-}
diff --git a/node_modules/ansi-regex/.travis.yml b/node_modules/ansi-regex/.travis.yml
deleted file mode 100644
index 244b7e8..0000000
--- a/node_modules/ansi-regex/.travis.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-language: node_js
-node_js:
- - '0.10'
diff --git a/node_modules/ansi-regex/index.js b/node_modules/ansi-regex/index.js
deleted file mode 100644
index 783c5c7..0000000
--- a/node_modules/ansi-regex/index.js
+++ /dev/null
@@ -1,4 +0,0 @@
-'use strict';
-module.exports = function () {
- return /\u001b\[(?:[0-9]{1,3}(?:;[0-9]{1,3})*)?[m|K]/g;
-};
diff --git a/node_modules/ansi-regex/license b/node_modules/ansi-regex/license
deleted file mode 100644
index 654d0bf..0000000
--- a/node_modules/ansi-regex/license
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) Sindre Sorhus <sindresorhus at 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/ansi-regex/package.json b/node_modules/ansi-regex/package.json
deleted file mode 100644
index 2734a78..0000000
--- a/node_modules/ansi-regex/package.json
+++ /dev/null
@@ -1,51 +0,0 @@
-{
- "name": "ansi-regex",
- "version": "0.2.1",
- "description": "Regular expression for matching ANSI escape codes",
- "license": "MIT",
- "repository": "sindresorhus/ansi-regex",
- "author": {
- "name": "Sindre Sorhus",
- "email": "sindresorhus at gmail.com",
- "url": "http://sindresorhus.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",
- "command-line",
- "text",
- "regex",
- "regexp",
- "re",
- "match",
- "test",
- "find",
- "pattern"
- ],
- "devDependencies": {
- "mocha": "*"
- }
-}
diff --git a/node_modules/ansi-regex/readme.md b/node_modules/ansi-regex/readme.md
deleted file mode 100644
index ae876e7..0000000
--- a/node_modules/ansi-regex/readme.md
+++ /dev/null
@@ -1,33 +0,0 @@
-# ansi-regex [![Build Status](https://travis-ci.org/sindresorhus/ansi-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/ansi-regex)
-
-> Regular expression for matching [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)
-
-
-## Install
-
-```sh
-$ npm install --save ansi-regex
-```
-
-
-## Usage
-
-```js
-var ansiRegex = require('ansi-regex');
-
-ansiRegex().test('\u001b[4mcake\u001b[0m');
-//=> true
-
-ansiRegex().test('cake');
-//=> false
-
-'\u001b[4mcake\u001b[0m'.match(ansiRegex());
-//=> ['\u001b[4m', '\u001b[0m']
-```
-
-*It's a function so you can create multiple instances. Regexes with the global flag will have the `.lastIndex` property changed for each call to methods on the instance. Therefore reusing the instance with multiple calls will not work as expected for `.test()`.*
-
-
-## License
-
-MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/node_modules/ansi-regex/test.js b/node_modules/ansi-regex/test.js
deleted file mode 100644
index 7081ed6..0000000
--- a/node_modules/ansi-regex/test.js
+++ /dev/null
@@ -1,19 +0,0 @@
-'use strict';
-var assert = require('assert');
-var ansiRegex = require('./');
-
-it('should match ansi code in a string', function () {
- assert(ansiRegex().test('foo\u001b[4mcake\u001b[0m'));
- assert(ansiRegex().test('\u001b[4mcake\u001b[0m'));
- assert(ansiRegex().test('foo\u001b[4mcake\u001b[0m'));
- assert(ansiRegex().test('\u001b[0m\u001b[4m\u001b[42m\u001b[31mfoo\u001b[39m\u001b[49m\u001b[24mfoo\u001b[0m'));
- assert(ansiRegex().test('foo\u001b[mfoo'));
-});
-
-it('should match ansi code from ls command', function () {
- assert(ansiRegex().test('\u001b[00;38;5;244m\u001b[m\u001b[00;38;5;33mfoo\u001b[0m'));
-});
-
-it('should match reset;setfg;setbg;italics;strike;underline sequence in a string', function () {
- assert(ansiRegex().test('\u001b[0;33;49;3;9;4mbar\u001b[0m'));
-});
diff --git a/node_modules/ansi-styles/.editorconfig b/node_modules/ansi-styles/.editorconfig
deleted file mode 100644
index 8311fe1..0000000
--- a/node_modules/ansi-styles/.editorconfig
+++ /dev/null
@@ -1,16 +0,0 @@
-# editorconfig.org
-root = true
-
-[*]
-indent_style = tab
-end_of_line = lf
-charset = utf-8
-trim_trailing_whitespace = true
-insert_final_newline = true
-
-[package.json]
-indent_style = space
-indent_size = 2
-
-[*.md]
-trim_trailing_whitespace = false
diff --git a/node_modules/ansi-styles/.gitattributes b/node_modules/ansi-styles/.gitattributes
deleted file mode 100644
index 176a458..0000000
--- a/node_modules/ansi-styles/.gitattributes
+++ /dev/null
@@ -1 +0,0 @@
-* text=auto
diff --git a/node_modules/ansi-styles/.gitignore b/node_modules/ansi-styles/.gitignore
deleted file mode 100644
index 3c3629e..0000000
--- a/node_modules/ansi-styles/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-node_modules
diff --git a/node_modules/ansi-styles/.jshintrc b/node_modules/ansi-styles/.jshintrc
deleted file mode 100644
index c511975..0000000
--- a/node_modules/ansi-styles/.jshintrc
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "node": true,
- "esnext": true,
- "bitwise": true,
- "camelcase": true,
- "curly": true,
- "eqeqeq": true,
- "immed": true,
- "indent": 4,
- "newcap": true,
- "noarg": true,
- "quotmark": "single",
- "undef": true,
- "unused": "vars",
- "strict": true
-}
diff --git a/node_modules/ansi-styles/.travis.yml b/node_modules/ansi-styles/.travis.yml
deleted file mode 100644
index 244b7e8..0000000
--- a/node_modules/ansi-styles/.travis.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-language: node_js
-node_js:
- - '0.10'
diff --git a/node_modules/ansi-styles/index.js b/node_modules/ansi-styles/index.js
deleted file mode 100644
index 2d8b472..0000000
--- a/node_modules/ansi-styles/index.js
+++ /dev/null
@@ -1,40 +0,0 @@
-'use strict';
-var styles = module.exports;
-
-var codes = {
- 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],
-
- 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],
-
- bgBlack: [40, 49],
- bgRed: [41, 49],
- bgGreen: [42, 49],
- bgYellow: [43, 49],
- bgBlue: [44, 49],
- bgMagenta: [45, 49],
- bgCyan: [46, 49],
- bgWhite: [47, 49]
-};
-
-Object.keys(codes).forEach(function (key) {
- var val = codes[key];
- var style = styles[key] = {};
- style.open = '\u001b[' + val[0] + 'm';
- style.close = '\u001b[' + val[1] + 'm';
-});
diff --git a/node_modules/ansi-styles/license b/node_modules/ansi-styles/license
deleted file mode 100644
index 654d0bf..0000000
--- a/node_modules/ansi-styles/license
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) Sindre Sorhus <sindresorhus at 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/ansi-styles/package.json b/node_modules/ansi-styles/package.json
deleted file mode 100644
index a9ba607..0000000
--- a/node_modules/ansi-styles/package.json
+++ /dev/null
@@ -1,46 +0,0 @@
-{
- "name": "ansi-styles",
- "version": "1.1.0",
- "description": "ANSI escape codes for styling strings in the terminal",
- "license": "MIT",
- "repository": "sindresorhus/ansi-styles",
- "author": {
- "name": "Sindre Sorhus",
- "email": "sindresorhus at gmail.com",
- "url": "http://sindresorhus.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/ansi-styles/readme.md b/node_modules/ansi-styles/readme.md
deleted file mode 100644
index 73584cc..0000000
--- a/node_modules/ansi-styles/readme.md
+++ /dev/null
@@ -1,70 +0,0 @@
-# ansi-styles [![Build Status](https://travis-ci.org/sindresorhus/ansi-styles.svg?branch=master)](https://travis-ci.org/sindresorhus/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/sindresorhus/chalk) module for styling your strings.
-
-![screenshot](screenshot.png)
-
-
-## Install
-
-```sh
-$ 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
-
-### General
-
-- `reset`
-- `bold`
-- `dim`
-- `italic` *(not widely supported)*
-- `underline`
-- `inverse`
-- `hidden`
-- `strikethrough` *(not widely supported)*
-
-### Text colors
-
-- `black`
-- `red`
-- `green`
-- `yellow`
-- `blue`
-- `magenta`
-- `cyan`
-- `white`
-- `gray`
-
-### Background colors
-
-- `bgBlack`
-- `bgRed`
-- `bgGreen`
-- `bgYellow`
-- `bgBlue`
-- `bgMagenta`
-- `bgCyan`
-- `bgWhite`
-
-
-## License
-
-MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/node_modules/ansi-styles/screenshot.png b/node_modules/ansi-styles/screenshot.png
deleted file mode 100644
index ec618af..0000000
Binary files a/node_modules/ansi-styles/screenshot.png and /dev/null differ
diff --git a/node_modules/ansi-styles/test.js b/node_modules/ansi-styles/test.js
deleted file mode 100644
index f030ca7..0000000
--- a/node_modules/ansi-styles/test.js
+++ /dev/null
@@ -1,26 +0,0 @@
-'use strict';
-var assert = require('assert');
-var ansi = require('./');
-
-// generates the screenshot
-Object.keys(ansi).forEach(function (el) {
- var style = ansi[el].open;
-
- if (el === 'reset' || el === 'hidden') {
- return;
- }
-
- if (/^bg[^B]/.test(el)) {
- style = ansi.black.open + style;
- }
-
- process.stdout.write(style + el + ansi.reset.open + ansi.reset.close + ' ');
-});
-
-describe('ansiStyles()', function () {
- it('should return ANSI escape codes', function () {
- assert.equal(ansi.green.open, '\x1b[32m');
- assert.equal(ansi.bgGreen.open, '\x1b[42m');
- assert.equal(ansi.green.close, '\x1b[39m');
- });
-});
diff --git a/node_modules/escape-string-regexp/.editorconfig b/node_modules/escape-string-regexp/.editorconfig
deleted file mode 100644
index 8311fe1..0000000
--- a/node_modules/escape-string-regexp/.editorconfig
+++ /dev/null
@@ -1,16 +0,0 @@
-# editorconfig.org
-root = true
-
-[*]
-indent_style = tab
-end_of_line = lf
-charset = utf-8
-trim_trailing_whitespace = true
-insert_final_newline = true
-
-[package.json]
-indent_style = space
-indent_size = 2
-
-[*.md]
-trim_trailing_whitespace = false
diff --git a/node_modules/escape-string-regexp/.gitattributes b/node_modules/escape-string-regexp/.gitattributes
deleted file mode 100644
index 176a458..0000000
--- a/node_modules/escape-string-regexp/.gitattributes
+++ /dev/null
@@ -1 +0,0 @@
-* text=auto
diff --git a/node_modules/escape-string-regexp/.gitignore b/node_modules/escape-string-regexp/.gitignore
deleted file mode 100644
index 3c3629e..0000000
--- a/node_modules/escape-string-regexp/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-node_modules
diff --git a/node_modules/escape-string-regexp/.jshintrc b/node_modules/escape-string-regexp/.jshintrc
deleted file mode 100644
index 804f8af..0000000
--- a/node_modules/escape-string-regexp/.jshintrc
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "node": true,
- "esnext": true,
- "bitwise": true,
- "camelcase": true,
- "curly": true,
- "immed": true,
- "newcap": true,
- "noarg": true,
- "undef": true,
- "unused": "vars",
- "strict": true
-}
diff --git a/node_modules/escape-string-regexp/.travis.yml b/node_modules/escape-string-regexp/.travis.yml
deleted file mode 100644
index 244b7e8..0000000
--- a/node_modules/escape-string-regexp/.travis.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-language: node_js
-node_js:
- - '0.10'
diff --git a/node_modules/escape-string-regexp/index.js b/node_modules/escape-string-regexp/index.js
deleted file mode 100644
index ac6572c..0000000
--- a/node_modules/escape-string-regexp/index.js
+++ /dev/null
@@ -1,11 +0,0 @@
-'use strict';
-
-var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
-
-module.exports = function (str) {
- if (typeof str !== 'string') {
- throw new TypeError('Expected a string');
- }
-
- return str.replace(matchOperatorsRe, '\\$&');
-};
diff --git a/node_modules/escape-string-regexp/license b/node_modules/escape-string-regexp/license
deleted file mode 100644
index 654d0bf..0000000
--- a/node_modules/escape-string-regexp/license
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) Sindre Sorhus <sindresorhus at 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/escape-string-regexp/package.json b/node_modules/escape-string-regexp/package.json
deleted file mode 100644
index 8da659f..0000000
--- a/node_modules/escape-string-regexp/package.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "name": "escape-string-regexp",
- "version": "1.0.1",
- "description": "Escape RegExp special characters",
- "license": "MIT",
- "repository": "sindresorhus/escape-string-regexp",
- "author": {
- "name": "Sindre Sorhus",
- "email": "sindresorhus at gmail.com",
- "url": "http://sindresorhus.com"
- },
- "engines": {
- "node": ">=0.10.0"
- },
- "scripts": {
- "test": "mocha"
- },
- "files": [
- "index.js"
- ],
- "keywords": [
- "regex",
- "regexp",
- "re",
- "regular",
- "expression",
- "escape",
- "string",
- "str",
- "special",
- "characters"
- ],
- "devDependencies": {
- "mocha": "*"
- }
-}
diff --git a/node_modules/escape-string-regexp/readme.md b/node_modules/escape-string-regexp/readme.md
deleted file mode 100644
index 808a963..0000000
--- a/node_modules/escape-string-regexp/readme.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# escape-string-regexp [![Build Status](https://travis-ci.org/sindresorhus/escape-string-regexp.svg?branch=master)](https://travis-ci.org/sindresorhus/escape-string-regexp)
-
-> Escape RegExp special characters
-
-
-## Install
-
-```sh
-$ npm install --save escape-string-regexp
-```
-
-
-## Usage
-
-```js
-var escapeStringRegexp = require('escape-string-regexp');
-
-var escapedString = escapeStringRegexp('how much $ for a unicorn?');
-//=> how much \$ for a unicorn\?
-
-new RegExp(escapedString);
-```
-
-
-## License
-
-MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/node_modules/escape-string-regexp/test.js b/node_modules/escape-string-regexp/test.js
deleted file mode 100644
index f968b71..0000000
--- a/node_modules/escape-string-regexp/test.js
+++ /dev/null
@@ -1,7 +0,0 @@
-'use strict';
-var assert = require('assert');
-var escapeStringRegexp = require('./');
-
-it('should escape RegExp special characters', function () {
- assert.strictEqual(escapeStringRegexp('\\ ^ $ * + ? . ( ) | { } [ ]'), '\\\\ \\^ \\$ \\* \\+ \\? \\. \\( \\) \\| \\{ \\} \\[ \\]');
-});
diff --git a/node_modules/has-ansi/.editorconfig b/node_modules/has-ansi/.editorconfig
deleted file mode 100644
index 8311fe1..0000000
--- a/node_modules/has-ansi/.editorconfig
+++ /dev/null
@@ -1,16 +0,0 @@
-# editorconfig.org
-root = true
-
-[*]
-indent_style = tab
-end_of_line = lf
-charset = utf-8
-trim_trailing_whitespace = true
-insert_final_newline = true
-
-[package.json]
-indent_style = space
-indent_size = 2
-
-[*.md]
-trim_trailing_whitespace = false
diff --git a/node_modules/has-ansi/.gitattributes b/node_modules/has-ansi/.gitattributes
deleted file mode 100644
index 176a458..0000000
--- a/node_modules/has-ansi/.gitattributes
+++ /dev/null
@@ -1 +0,0 @@
-* text=auto
diff --git a/node_modules/has-ansi/.gitignore b/node_modules/has-ansi/.gitignore
deleted file mode 100644
index 3c3629e..0000000
--- a/node_modules/has-ansi/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-node_modules
diff --git a/node_modules/has-ansi/.jshintrc b/node_modules/has-ansi/.jshintrc
deleted file mode 100644
index 804f8af..0000000
--- a/node_modules/has-ansi/.jshintrc
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "node": true,
- "esnext": true,
- "bitwise": true,
- "camelcase": true,
- "curly": true,
- "immed": true,
- "newcap": true,
- "noarg": true,
- "undef": true,
- "unused": "vars",
- "strict": true
-}
diff --git a/node_modules/has-ansi/.travis.yml b/node_modules/has-ansi/.travis.yml
deleted file mode 100644
index 244b7e8..0000000
--- a/node_modules/has-ansi/.travis.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-language: node_js
-node_js:
- - '0.10'
diff --git a/node_modules/has-ansi/cli.js b/node_modules/has-ansi/cli.js
deleted file mode 100755
index e0956fc..0000000
--- a/node_modules/has-ansi/cli.js
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/usr/bin/env node
-'use strict';
-var pkg = require('./package.json');
-var hasAnsi = require('./');
-var input = process.argv[2];
-
-function stdin(cb) {
- var ret = '';
- process.stdin.setEncoding('utf8');
- process.stdin.on('data', function (data) {
- ret += data;
- });
- process.stdin.on('end', function () {
- cb(ret);
- });
-}
-
-function help() {
- console.log([
- pkg.description,
- '',
- 'Usage',
- ' $ has-ansi <string>',
- ' $ echo <string> | has-ansi',
- '',
- 'Exits with code 0 if input has ANSI escape codes and 1 if not'
- ].join('\n'));
-}
-
-function init(data) {
- process.exit(hasAnsi(data) ? 0 : 1);
-}
-
-if (process.argv.indexOf('--help') !== -1) {
- help();
- return;
-}
-
-if (process.argv.indexOf('--version') !== -1) {
- console.log(pkg.version);
- return;
-}
-
-if (process.stdin.isTTY) {
- if (!input) {
- help();
- return;
- }
-
- init(input);
-} else {
- stdin(init);
-}
diff --git a/node_modules/has-ansi/index.js b/node_modules/has-ansi/index.js
deleted file mode 100644
index 98fae06..0000000
--- a/node_modules/has-ansi/index.js
+++ /dev/null
@@ -1,4 +0,0 @@
-'use strict';
-var ansiRegex = require('ansi-regex');
-var re = new RegExp(ansiRegex().source); // remove the `g` flag
-module.exports = re.test.bind(re);
diff --git a/node_modules/has-ansi/license b/node_modules/has-ansi/license
deleted file mode 100644
index 654d0bf..0000000
--- a/node_modules/has-ansi/license
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) Sindre Sorhus <sindresorhus at 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/has-ansi/package.json b/node_modules/has-ansi/package.json
deleted file mode 100644
index 047ff0d..0000000
--- a/node_modules/has-ansi/package.json
+++ /dev/null
@@ -1,57 +0,0 @@
-{
- "name": "has-ansi",
- "version": "0.1.0",
- "description": "Check if a string has ANSI escape codes",
- "license": "MIT",
- "repository": "sindresorhus/has-ansi",
- "bin": {
- "has-ansi": "cli.js"
- },
- "author": {
- "name": "Sindre Sorhus",
- "email": "sindresorhus at gmail.com",
- "url": "http://sindresorhus.com"
- },
- "engines": {
- "node": ">=0.10.0"
- },
- "scripts": {
- "test": "mocha"
- },
- "files": [
- "index.js",
- "cli.js"
- ],
- "keywords": [
- "cli",
- "bin",
- "ansi",
- "styles",
- "color",
- "colour",
- "colors",
- "terminal",
- "console",
- "string",
- "tty",
- "escape",
- "shell",
- "xterm",
- "command-line",
- "text",
- "regex",
- "regexp",
- "re",
- "match",
- "test",
- "find",
- "pattern",
- "has"
- ],
- "dependencies": {
- "ansi-regex": "^0.2.0"
- },
- "devDependencies": {
- "mocha": "*"
- }
-}
diff --git a/node_modules/has-ansi/readme.md b/node_modules/has-ansi/readme.md
deleted file mode 100644
index 0702212..0000000
--- a/node_modules/has-ansi/readme.md
+++ /dev/null
@@ -1,45 +0,0 @@
-# has-ansi [![Build Status](https://travis-ci.org/sindresorhus/has-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/has-ansi)
-
-> Check if a string has [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)
-
-
-## Install
-
-```sh
-$ npm install --save has-ansi
-```
-
-
-## Usage
-
-```js
-var hasAnsi = require('has-ansi');
-
-hasAnsi('\u001b[4mcake\u001b[0m');
-//=> true
-
-hasAnsi('cake');
-//=> false
-```
-
-
-## CLI
-
-```sh
-$ npm install --global has-ansi
-```
-
-```
-$ has-ansi --help
-
-Usage
- $ has-ansi <string>
- $ echo <string> | has-ansi
-
-Exits with code 0 if input has ANSI escape codes and 1 if not
-```
-
-
-## License
-
-MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/node_modules/has-ansi/test.js b/node_modules/has-ansi/test.js
deleted file mode 100644
index 941138b..0000000
--- a/node_modules/has-ansi/test.js
+++ /dev/null
@@ -1,8 +0,0 @@
-'use strict';
-var assert = require('assert');
-var hasAnsi = require('./');
-
-it('should check if a string has ANSI escape codes', function () {
- assert(hasAnsi('foo\u001b[4mcake\u001b[0m'));
- assert(!hasAnsi('cake'));
-});
diff --git a/node_modules/strip-ansi/.editorconfig b/node_modules/strip-ansi/.editorconfig
deleted file mode 100644
index 8311fe1..0000000
--- a/node_modules/strip-ansi/.editorconfig
+++ /dev/null
@@ -1,16 +0,0 @@
-# editorconfig.org
-root = true
-
-[*]
-indent_style = tab
-end_of_line = lf
-charset = utf-8
-trim_trailing_whitespace = true
-insert_final_newline = true
-
-[package.json]
-indent_style = space
-indent_size = 2
-
-[*.md]
-trim_trailing_whitespace = false
diff --git a/node_modules/strip-ansi/.gitattributes b/node_modules/strip-ansi/.gitattributes
deleted file mode 100644
index 176a458..0000000
--- a/node_modules/strip-ansi/.gitattributes
+++ /dev/null
@@ -1 +0,0 @@
-* text=auto
diff --git a/node_modules/strip-ansi/.gitignore b/node_modules/strip-ansi/.gitignore
deleted file mode 100644
index 3c3629e..0000000
--- a/node_modules/strip-ansi/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-node_modules
diff --git a/node_modules/strip-ansi/.jshintrc b/node_modules/strip-ansi/.jshintrc
deleted file mode 100644
index c511975..0000000
--- a/node_modules/strip-ansi/.jshintrc
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "node": true,
- "esnext": true,
- "bitwise": true,
- "camelcase": true,
- "curly": true,
- "eqeqeq": true,
- "immed": true,
- "indent": 4,
- "newcap": true,
- "noarg": true,
- "quotmark": "single",
- "undef": true,
- "unused": "vars",
- "strict": true
-}
diff --git a/node_modules/strip-ansi/.travis.yml b/node_modules/strip-ansi/.travis.yml
deleted file mode 100644
index 244b7e8..0000000
--- a/node_modules/strip-ansi/.travis.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-language: node_js
-node_js:
- - '0.10'
diff --git a/node_modules/strip-ansi/cli.js b/node_modules/strip-ansi/cli.js
deleted file mode 100755
index 602ae00..0000000
--- a/node_modules/strip-ansi/cli.js
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/env node
-'use strict';
-var fs = require('fs');
-var pkg = require('./package.json');
-var strip = require('./');
-var input = process.argv[2];
-
-function help() {
- console.log([
- pkg.description,
- '',
- 'Usage',
- ' $ strip-ansi <input-file> > <output-file>',
- ' $ cat <input-file> | strip-ansi > <output-file>',
- '',
- 'Example',
- ' $ strip-ansi unicorn.txt > unicorn-stripped.txt'
- ].join('\n'));
-}
-
-if (process.argv.indexOf('--help') !== -1) {
- help();
- return;
-}
-
-if (process.argv.indexOf('--version') !== -1) {
- console.log(pkg.version);
- return;
-}
-
-if (input) {
- process.stdout.write(strip(fs.readFileSync(input, 'utf8')));
- return;
-}
-
-process.stdin.setEncoding('utf8');
-process.stdin.on('data', function (data) {
- process.stdout.write(strip(data));
-});
diff --git a/node_modules/strip-ansi/index.js b/node_modules/strip-ansi/index.js
deleted file mode 100644
index 099480f..0000000
--- a/node_modules/strip-ansi/index.js
+++ /dev/null
@@ -1,6 +0,0 @@
-'use strict';
-var ansiRegex = require('ansi-regex')();
-
-module.exports = function (str) {
- return typeof str === 'string' ? str.replace(ansiRegex, '') : str;
-};
diff --git a/node_modules/strip-ansi/license b/node_modules/strip-ansi/license
deleted file mode 100644
index 654d0bf..0000000
--- a/node_modules/strip-ansi/license
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) Sindre Sorhus <sindresorhus at 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/strip-ansi/package.json b/node_modules/strip-ansi/package.json
deleted file mode 100644
index 3bacc67..0000000
--- a/node_modules/strip-ansi/package.json
+++ /dev/null
@@ -1,56 +0,0 @@
-{
- "name": "strip-ansi",
- "version": "0.3.0",
- "description": "Strip ANSI escape codes",
- "license": "MIT",
- "bin": {
- "strip-ansi": "cli.js"
- },
- "repository": "sindresorhus/strip-ansi",
- "author": {
- "name": "Sindre Sorhus",
- "email": "sindresorhus at gmail.com",
- "url": "http://sindresorhus.com"
- },
- "engines": {
- "node": ">=0.10.0"
- },
- "scripts": {
- "test": "mocha"
- },
- "files": [
- "index.js",
- "cli.js"
- ],
- "keywords": [
- "strip",
- "trim",
- "remove",
- "ansi",
- "styles",
- "color",
- "colour",
- "colors",
- "terminal",
- "console",
- "cli",
- "string",
- "tty",
- "escape",
- "formatting",
- "rgb",
- "256",
- "shell",
- "xterm",
- "log",
- "logging",
- "command-line",
- "text"
- ],
- "dependencies": {
- "ansi-regex": "^0.2.1"
- },
- "devDependencies": {
- "mocha": "*"
- }
-}
diff --git a/node_modules/strip-ansi/readme.md b/node_modules/strip-ansi/readme.md
deleted file mode 100644
index 5477079..0000000
--- a/node_modules/strip-ansi/readme.md
+++ /dev/null
@@ -1,43 +0,0 @@
-# strip-ansi [![Build Status](https://travis-ci.org/sindresorhus/strip-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-ansi)
-
-> Strip [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)
-
-
-## Install
-
-```sh
-$ npm install --save strip-ansi
-```
-
-
-## Usage
-
-```js
-var stripAnsi = require('strip-ansi');
-
-stripAnsi('\x1b[4mcake\x1b[0m');
-//=> 'cake'
-```
-
-
-## CLI
-
-```sh
-$ npm install --global strip-ansi
-```
-
-```sh
-$ strip-ansi --help
-
-Usage
- $ strip-ansi <input-file> > <output-file>
- $ cat <input-file> | strip-ansi > <output-file>
-
-Example
- $ strip-ansi unicorn.txt > unicorn-stripped.txt
-```
-
-
-## License
-
-MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/node_modules/strip-ansi/test.js b/node_modules/strip-ansi/test.js
deleted file mode 100644
index f7f456e..0000000
--- a/node_modules/strip-ansi/test.js
+++ /dev/null
@@ -1,23 +0,0 @@
-'use strict';
-var assert = require('assert');
-var exec = require('child_process').exec;
-var strip = require('./');
-
-it('should strip color from string', function () {
- assert.equal(strip('\u001b[0m\u001b[4m\u001b[42m\u001b[31mfoo\u001b[39m\u001b[49m\u001b[24mfoo\u001b[0m'), 'foofoo');
-});
-
-it('should strip color from ls command', function () {
- assert.equal(strip('\u001b[00;38;5;244m\u001b[m\u001b[00;38;5;33mfoo\u001b[0m'), 'foo');
-});
-
-it('should strip reset;setfg;setbg;italics;strike;underline sequence from string', function () {
- assert.equal(strip('\x1b[0;33;49;3;9;4mbar\x1b[0m'), 'bar');
-});
-
-it('should strip color with CLI', function (cb) {
- exec('echo "\u001b[0m\u001b[4m\u001b[42m\u001b[31mfoo\u001b[39m\u001b[49m\u001b[24mfoo\u001b[0m" | ./cli.js', function (err, stdout) {
- assert.equal(stdout, 'foofoo\n');
- cb();
- });
-});
diff --git a/node_modules/supports-color/.editorconfig b/node_modules/supports-color/.editorconfig
deleted file mode 100644
index 8311fe1..0000000
--- a/node_modules/supports-color/.editorconfig
+++ /dev/null
@@ -1,16 +0,0 @@
-# editorconfig.org
-root = true
-
-[*]
-indent_style = tab
-end_of_line = lf
-charset = utf-8
-trim_trailing_whitespace = true
-insert_final_newline = true
-
-[package.json]
-indent_style = space
-indent_size = 2
-
-[*.md]
-trim_trailing_whitespace = false
diff --git a/node_modules/supports-color/.gitattributes b/node_modules/supports-color/.gitattributes
deleted file mode 100644
index 176a458..0000000
--- a/node_modules/supports-color/.gitattributes
+++ /dev/null
@@ -1 +0,0 @@
-* text=auto
diff --git a/node_modules/supports-color/.gitignore b/node_modules/supports-color/.gitignore
deleted file mode 100644
index 3c3629e..0000000
--- a/node_modules/supports-color/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-node_modules
diff --git a/node_modules/supports-color/.jshintrc b/node_modules/supports-color/.jshintrc
deleted file mode 100644
index 804f8af..0000000
--- a/node_modules/supports-color/.jshintrc
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "node": true,
- "esnext": true,
- "bitwise": true,
- "camelcase": true,
- "curly": true,
- "immed": true,
- "newcap": true,
- "noarg": true,
- "undef": true,
- "unused": "vars",
- "strict": true
-}
diff --git a/node_modules/supports-color/.travis.yml b/node_modules/supports-color/.travis.yml
deleted file mode 100644
index 244b7e8..0000000
--- a/node_modules/supports-color/.travis.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-language: node_js
-node_js:
- - '0.10'
diff --git a/node_modules/supports-color/cli.js b/node_modules/supports-color/cli.js
deleted file mode 100755
index 0617971..0000000
--- a/node_modules/supports-color/cli.js
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/env node
-'use strict';
-var pkg = require('./package.json');
-var supportsColor = require('./');
-var input = process.argv[2];
-
-function help() {
- console.log([
- pkg.description,
- '',
- 'Usage',
- ' $ supports-color',
- '',
- 'Exits with code 0 if color is supported and 1 if not'
- ].join('\n'));
-}
-
-if (!input || process.argv.indexOf('--help') !== -1) {
- help();
- return;
-}
-
-if (process.argv.indexOf('--version') !== -1) {
- console.log(pkg.version);
- return;
-}
-
-process.exit(supportsColor ? 0 : 1);
diff --git a/node_modules/supports-color/index.js b/node_modules/supports-color/index.js
deleted file mode 100644
index 092d0ba..0000000
--- a/node_modules/supports-color/index.js
+++ /dev/null
@@ -1,32 +0,0 @@
-'use strict';
-module.exports = (function () {
- if (process.argv.indexOf('--no-color') !== -1) {
- return false;
- }
-
- if (process.argv.indexOf('--color') !== -1) {
- 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/supports-color/license b/node_modules/supports-color/license
deleted file mode 100644
index 654d0bf..0000000
--- a/node_modules/supports-color/license
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) Sindre Sorhus <sindresorhus at 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/supports-color/package.json b/node_modules/supports-color/package.json
deleted file mode 100644
index 02b0197..0000000
--- a/node_modules/supports-color/package.json
+++ /dev/null
@@ -1,50 +0,0 @@
-{
- "name": "supports-color",
- "version": "0.2.0",
- "description": "Detect whether a terminal supports color",
- "license": "MIT",
- "repository": "sindresorhus/supports-color",
- "bin": {
- "supports-color": "cli.js"
- },
- "author": {
- "name": "Sindre Sorhus",
- "email": "sindresorhus at gmail.com",
- "url": "http://sindresorhus.com"
- },
- "engines": {
- "node": ">=0.10.0"
- },
- "scripts": {
- "test": "mocha"
- },
- "files": [
- "index.js",
- "cli.js"
- ],
- "keywords": [
- "cli",
- "bin",
- "color",
- "colour",
- "colors",
- "terminal",
- "console",
- "cli",
- "ansi",
- "styles",
- "tty",
- "rgb",
- "256",
- "shell",
- "xterm",
- "command-line",
- "support",
- "supports",
- "capability",
- "detect"
- ],
- "devDependencies": {
- "mocha": "*"
- }
-}
diff --git a/node_modules/supports-color/readme.md b/node_modules/supports-color/readme.md
deleted file mode 100644
index 7f07e5f..0000000
--- a/node_modules/supports-color/readme.md
+++ /dev/null
@@ -1,44 +0,0 @@
-# supports-color [![Build Status](https://travis-ci.org/sindresorhus/supports-color.svg?branch=master)](https://travis-ci.org/sindresorhus/supports-color)
-
-> Detect whether a terminal supports color
-
-
-## Install
-
-```sh
-$ 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.
-
-
-## CLI
-
-```sh
-$ npm install --global supports-color
-```
-
-```sh
-$ supports-color --help
-
-Usage
- $ supports-color
-
-# Exits with code 0 if color is supported and 1 if not
-```
-
-
-## License
-
-MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/node_modules/supports-color/test.js b/node_modules/supports-color/test.js
deleted file mode 100644
index 4c5c1e8..0000000
--- a/node_modules/supports-color/test.js
+++ /dev/null
@@ -1,30 +0,0 @@
-'use strict';
-var assert = require('assert');
-
-beforeEach(function () {
- // clear the cache of the tested module
- delete require.cache[require.resolve('./')];
- process.stdout.isTTY = true;
- process.argv = [];
- process.env = {};
-});
-
-it('should return false if not TTY', function () {
- process.stdout.isTTY = false;
- assert.equal(require('./'), false);
-});
-
-it('should return false if --no-color flag is used', function () {
- process.argv = ['--no-color'];
- assert.equal(require('./'), false);
-});
-
-it('should return true if --color flag is used', function () {
- process.argv = ['--color'];
- assert.equal(require('./'), true);
-});
-
-it('should return true if `COLORTERM` is in env', function () {
- process.env.COLORTERM = true;
- assert.equal(require('./'), true);
-});
diff --git a/package.json b/package.json
index e58fe48..f6d23b1 100644
--- a/package.json
+++ b/package.json
@@ -1,12 +1,12 @@
{
"name": "chalk",
- "version": "0.5.1",
- "description": "Terminal string styling done right. Created because the `colors` module does some really horrible things.",
+ "version": "1.0.0",
+ "description": "Terminal string styling done right. Much color.",
"license": "MIT",
"repository": "sindresorhus/chalk",
"maintainers": [
"Sindre Sorhus <sindresorhus at gmail.com> (http://sindresorhus.com)",
- "Joshua Appelman <joshua at jbna.nl>"
+ "Joshua Appelman <jappelman at xebia.com> (http://jbnicolai.com)"
],
"engines": {
"node": ">=0.10.0"
@@ -40,14 +40,14 @@
"text"
],
"dependencies": {
- "ansi-styles": "^1.1.0",
- "escape-string-regexp": "^1.0.0",
- "has-ansi": "^0.1.0",
- "strip-ansi": "^0.3.0",
- "supports-color": "^0.2.0"
+ "ansi-styles": "^2.0.1",
+ "escape-string-regexp": "^1.0.2",
+ "has-ansi": "^1.0.3",
+ "strip-ansi": "^2.0.1",
+ "supports-color": "^1.3.0"
},
"devDependencies": {
- "matcha": "^0.5.0",
+ "matcha": "^0.6.0",
"mocha": "*"
}
}
diff --git a/readme.md b/readme.md
index 239c791..43c7064 100644
--- a/readme.md
+++ b/readme.md
@@ -1,11 +1,15 @@
-# <img width="300" src="https://cdn.rawgit.com/sindresorhus/chalk/77ae94f63ab1ac61389b190e5a59866569d1a376/logo.svg" alt="chalk">
+<h1 align="center">
+ <br>
+ <img width="360" src="https://cdn.rawgit.com/sindresorhus/chalk/19935d6484811c5e468817f846b7b3d417d7bf4a/logo.svg" alt="chalk">
+ <br>
+ <br>
+</h1>
> Terminal string styling done right
-[![Build Status](https://travis-ci.org/sindresorhus/chalk.svg?branch=master)](https://travis-ci.org/sindresorhus/chalk)
-![](http://img.shields.io/badge/unicorn-approved-ff69b4.svg)
+[![Build Status](https://travis-ci.org/sindresorhus/chalk.svg?branch=master)](https://travis-ci.org/sindresorhus/chalk) [![](http://img.shields.io/badge/unicorn-approved-ff69b4.svg?style=flat)](https://www.youtube.com/watch?v=Sm368W0OsHo)
-[colors.js](https://github.com/Marak/colors.js) is currently 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.
+[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.
**Chalk is a clean and focused alternative.**
@@ -15,18 +19,18 @@
## Why
- Highly performant
-- Doesn't extend String.prototype
+- Doesn't extend `String.prototype`
- Expressive API
- Ability to nest styles
- Clean and focused
- Auto-detects color support
- Actively maintained
-- [Used by 1000+ modules](https://npmjs.org/browse/depended/chalk)
+- [Used by ~3000 modules](https://www.npmjs.com/browse/depended/chalk)
## Install
-```sh
+```
$ npm install --save chalk
```
@@ -39,22 +43,26 @@ Chalk comes with an easy to use composable API where you just chain and nest the
var chalk = require('chalk');
// style a string
-console.log( chalk.blue('Hello world!') );
+chalk.blue('Hello world!');
// combine styled and normal strings
-console.log( chalk.blue('Hello'), 'World' + chalk.red('!') );
+chalk.blue('Hello') + 'World' + chalk.red('!');
// compose multiple styles using the chainable API
-console.log( chalk.blue.bgRed.bold('Hello world!') );
+chalk.blue.bgRed.bold('Hello world!');
// pass in multiple arguments
-console.log( chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz') );
+chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz');
// nest styles
-console.log( chalk.red('Hello', chalk.underline.bgBlue('world') + '!') );
+chalk.red('Hello', chalk.underline.bgBlue('world') + '!');
// nest styles of the same type even (color, underline, background)
-console.log( chalk.green('I am a green line ' + chalk.blue('with a blue substring') + ' that becomes green again!') );
+chalk.green(
+ 'I am a green line ' +
+ chalk.blue.underline.bold('with a blue substring') +
+ ' that becomes green again!'
+);
```
Easily define your own themes.
@@ -80,27 +88,31 @@ 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.
+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.
+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.
-### chalk.supportsColor
+If you need to change this in a reusable module create a new instance:
+
+```js
+var ctx = new chalk.constructor({enabled: false});
+```
-Detect whether the terminal [supports color](https://github.com/sindresorhus/supports-color).
+### chalk.supportsColor
-Can be overridden by the user with the flags `--color` and `--no-color`.
+Detect whether the terminal [supports color](https://github.com/sindresorhus/supports-color). Used internally and handled for you, but exposed for convenience.
-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
Exposes the styles as [ANSI escape codes](https://github.com/sindresorhus/ansi-styles).
-Generally not useful, but you might need just the `.open` or `.close` escape code if you're mixing externally styled strings with yours.
+Generally not useful, but you might need just the `.open` or `.close` escape code if you're mixing externally styled strings with your own.
```js
var chalk = require('chalk');
@@ -135,7 +147,7 @@ if (!chalk.supportsColor) {
## Styles
-### General
+### Modifiers
- `reset`
- `bold`
@@ -146,13 +158,13 @@ if (!chalk.supportsColor) {
- `hidden`
- `strikethrough` *(not widely supported)*
-### Text colors
+### Colors
- `black`
- `red`
- `green`
- `yellow`
-- `blue`
+- `blue` *(on Windows the bright version is used as normal blue is illegible)*
- `magenta`
- `cyan`
- `white`
@@ -170,6 +182,16 @@ if (!chalk.supportsColor) {
- `bgWhite`
+## 256-colors
+
+Chalk does not support 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.
+
+
+## Windows
+
+If you're on Windows, do yourself a favor and use [`cmder`](http://bliker.github.io/cmder/) instead of `cmd.exe`.
+
+
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/test.js b/test.js
index 3e073a6..5787e18 100644
--- a/test.js
+++ b/test.js
@@ -10,37 +10,37 @@ describe('chalk', function () {
});
it('should support applying multiple styles at once', function () {
- assert.equal(chalk.red.bgGreen.underline('foo'), '\u001b[4m\u001b[42m\u001b[31mfoo\u001b[39m\u001b[49m\u001b[24m');
- assert.equal(chalk.underline.red.bgGreen('foo'), '\u001b[42m\u001b[31m\u001b[4mfoo\u001b[24m\u001b[39m\u001b[49m');
+ assert.equal(chalk.red.bgGreen.underline('foo'), '\u001b[31m\u001b[42m\u001b[4mfoo\u001b[24m\u001b[49m\u001b[39m');
+ assert.equal(chalk.underline.red.bgGreen('foo'), '\u001b[4m\u001b[31m\u001b[42mfoo\u001b[49m\u001b[39m\u001b[24m');
});
it('should support nesting styles', function () {
assert.equal(
chalk.red('foo' + chalk.underline.bgBlue('bar') + '!'),
- '\u001b[31mfoo\u001b[44m\u001b[4mbar\u001b[24m\u001b[49m!\u001b[39m'
+ '\u001b[31mfoo\u001b[4m\u001b[44mbar\u001b[49m\u001b[24m!\u001b[39m'
);
});
it('should support nesting styles of the same type (color, underline, bg)', function () {
assert.equal(
- chalk.red('a' + chalk.blue('b' + chalk.green('c') + 'b') + 'c'),
- '\u001b[31ma\u001b[34mb\u001b[32mc\u001b[34mb\u001b[31mc\u001b[39m'
+ chalk.red('a' + chalk.yellow('b' + chalk.green('c') + 'b') + 'c'),
+ '\u001b[31ma\u001b[33mb\u001b[32mc\u001b[33mb\u001b[31mc\u001b[39m'
);
});
it('should reset all styles with `.reset()`', function () {
- assert.equal(chalk.reset(chalk.red.bgGreen.underline('foo') + 'foo'), '\u001b[0m\u001b[4m\u001b[42m\u001b[31mfoo\u001b[39m\u001b[49m\u001b[24mfoo\u001b[0m');
+ assert.equal(chalk.reset(chalk.red.bgGreen.underline('foo') + 'foo'), '\u001b[0m\u001b[31m\u001b[42m\u001b[4mfoo\u001b[24m\u001b[49m\u001b[39mfoo\u001b[0m');
});
it('should be able to cache multiple styles', function() {
var red = chalk.red;
- var blue = chalk.blue;
+ var green = chalk.green;
var redBold = red.bold;
- var blueBold = blue.bold;
+ var greenBold = green.bold;
- assert.notEqual(red('foo'), blue('foo'));
- assert.notEqual(redBold('bar'), blueBold('bar'));
- assert.notEqual(blue('baz'), blueBold('baz'));
+ assert.notEqual(red('foo'), green('foo'));
+ assert.notEqual(redBold('bar'), greenBold('bar'));
+ assert.notEqual(green('baz'), greenBold('baz'));
});
it('should alias gray to grey', function () {
@@ -68,6 +68,14 @@ describe('chalk.enabled', function () {
});
});
+describe('chalk.constructor', function () {
+ it('should create a isolated context where colors can be disabled', function () {
+ var ctx = new chalk.constructor({enabled: false});
+ assert.equal(ctx.red('foo'), 'foo');
+ assert.equal(chalk.red('foo'), '\u001b[31mfoo\u001b[39m');
+ });
+});
+
describe('chalk.styles', function () {
it('should expose the styles as ANSI escape codes', function () {
assert.equal(chalk.styles.red.open, '\u001b[31m');
@@ -76,8 +84,8 @@ describe('chalk.styles', function () {
describe('chalk.hasColor()', function () {
it('should detect whether a string has color', function () {
- assert(chalk.hasColor(chalk.blue('foo')));
- assert(!chalk.hasColor(chalk.stripColor(chalk.blue('foo'))));
+ assert(chalk.hasColor(chalk.green('foo')));
+ assert(!chalk.hasColor(chalk.stripColor(chalk.green('foo'))));
});
});
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-chalk.git
More information about the Pkg-javascript-commits
mailing list