[Pkg-javascript-commits] [node-chalk] 01/05: Imported Upstream version 0.5.1
Andrew Kelley
andrewrk-guest at moszumanska.debian.org
Wed Jul 30 06:09:28 UTC 2014
This is an automated email from the git hooks/post-receive script.
andrewrk-guest pushed a commit to branch master
in repository node-chalk.
commit bc0b3f9e94f5ff9020c7d2d58c4a4b6674c69caa
Author: Andrew Kelley <superjoe30 at gmail.com>
Date: Mon Jul 28 16:25:41 2014 +0000
Imported Upstream version 0.5.1
---
.jshintrc | 1 +
benchmark.js | 5 ++
index.js | 33 +++++++---
node_modules/ansi-regex/.editorconfig | 16 +++++
node_modules/ansi-regex/.gitattributes | 1 +
node_modules/ansi-regex/.gitignore | 1 +
.jshintrc => node_modules/ansi-regex/.jshintrc | 0
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 +
.jshintrc => node_modules/ansi-styles/.jshintrc | 0
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 0 -> 51858 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 +
.../escape-string-regexp/.jshintrc | 3 -
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 +
.jshintrc => node_modules/has-ansi/.jshintrc | 3 -
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 +
.jshintrc => node_modules/strip-ansi/.jshintrc | 0
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 +
.jshintrc => node_modules/supports-color/.jshintrc | 3 -
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 | 2 +-
test.js | 11 ++++
69 files changed, 1184 insertions(+), 17 deletions(-)
diff --git a/.jshintrc b/.jshintrc
index c511975..3e1760c 100644
--- a/.jshintrc
+++ b/.jshintrc
@@ -9,6 +9,7 @@
"indent": 4,
"newcap": true,
"noarg": true,
+ "proto": true,
"quotmark": "single",
"undef": true,
"unused": "vars",
diff --git a/benchmark.js b/benchmark.js
index da9ed8d..ce3f2c4 100644
--- a/benchmark.js
+++ b/benchmark.js
@@ -11,6 +11,11 @@ suite('chalk', function () {
chalk.blue.bgRed.bold('the fox jumps over the lazy dog');
});
+ var cached = chalk.blue.bgRed.bold;
+ bench('cached styles', function () {
+ cached('the fox jumps over the lazy dog');
+ });
+
bench('nested styles', function () {
chalk.red('the fox jumps', chalk.underline.bgBlue('over the lazy dog') + '!');
});
diff --git a/index.js b/index.js
index bc19485..ac1f168 100644
--- a/index.js
+++ b/index.js
@@ -7,6 +7,17 @@ var supportsColor = require('supports-color');
var defineProps = Object.defineProperties;
var chalk = module.exports;
+function build(_styles) {
+ var builder = function builder() {
+ return applyStyle.apply(builder, arguments);
+ };
+ builder._styles = _styles;
+ // __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;
+ return builder;
+}
+
var styles = (function () {
var ret = {};
@@ -17,8 +28,7 @@ var styles = (function () {
ret[key] = {
get: function () {
- this._styles.push(key);
- return this;
+ return build(this._styles.concat(key));
}
};
});
@@ -26,15 +36,26 @@ var styles = (function () {
return ret;
})();
+var proto = defineProps(function chalk() {}, styles);
+
function applyStyle() {
// support varags, but simply cast to string in case there's only one arg
- var str = arguments.length === 1 ? String(arguments[0]) : [].slice.call(arguments).join(' ');
+ var args = arguments;
+ var argsLen = args.length;
+ var str = argsLen !== 0 && String(arguments[0]);
+ if (argsLen > 1) {
+ // don't slice `arguments`, it prevents v8 optimizations
+ for (var a = 1; a < argsLen; a++) {
+ str += ' ' + args[a];
+ }
+ }
if (!chalk.enabled || !str) {
return str;
}
- var nestedStyles = applyStyle._styles;
+ /*jshint validthis: true*/
+ var nestedStyles = this._styles;
for (var i = 0; i < nestedStyles.length; i++) {
var code = ansiStyles[nestedStyles[i]];
@@ -51,11 +72,9 @@ function init() {
var ret = {};
Object.keys(styles).forEach(function (name) {
- var style = defineProps(applyStyle, styles);
ret[name] = {
get: function () {
- style._styles = [];
- return style[name];
+ return build([name]);
}
};
});
diff --git a/node_modules/ansi-regex/.editorconfig b/node_modules/ansi-regex/.editorconfig
new file mode 100644
index 0000000..8311fe1
--- /dev/null
+++ b/node_modules/ansi-regex/.editorconfig
@@ -0,0 +1,16 @@
+# 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
new file mode 100644
index 0000000..176a458
--- /dev/null
+++ b/node_modules/ansi-regex/.gitattributes
@@ -0,0 +1 @@
+* text=auto
diff --git a/node_modules/ansi-regex/.gitignore b/node_modules/ansi-regex/.gitignore
new file mode 100644
index 0000000..3c3629e
--- /dev/null
+++ b/node_modules/ansi-regex/.gitignore
@@ -0,0 +1 @@
+node_modules
diff --git a/.jshintrc b/node_modules/ansi-regex/.jshintrc
similarity index 100%
copy from .jshintrc
copy to node_modules/ansi-regex/.jshintrc
diff --git a/node_modules/ansi-regex/.travis.yml b/node_modules/ansi-regex/.travis.yml
new file mode 100644
index 0000000..244b7e8
--- /dev/null
+++ b/node_modules/ansi-regex/.travis.yml
@@ -0,0 +1,3 @@
+language: node_js
+node_js:
+ - '0.10'
diff --git a/node_modules/ansi-regex/index.js b/node_modules/ansi-regex/index.js
new file mode 100644
index 0000000..783c5c7
--- /dev/null
+++ b/node_modules/ansi-regex/index.js
@@ -0,0 +1,4 @@
+'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
new file mode 100644
index 0000000..654d0bf
--- /dev/null
+++ b/node_modules/ansi-regex/license
@@ -0,0 +1,21 @@
+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
new file mode 100644
index 0000000..2734a78
--- /dev/null
+++ b/node_modules/ansi-regex/package.json
@@ -0,0 +1,51 @@
+{
+ "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
new file mode 100644
index 0000000..ae876e7
--- /dev/null
+++ b/node_modules/ansi-regex/readme.md
@@ -0,0 +1,33 @@
+# ansi-regex [](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
new file mode 100644
index 0000000..7081ed6
--- /dev/null
+++ b/node_modules/ansi-regex/test.js
@@ -0,0 +1,19 @@
+'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
new file mode 100644
index 0000000..8311fe1
--- /dev/null
+++ b/node_modules/ansi-styles/.editorconfig
@@ -0,0 +1,16 @@
+# 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
new file mode 100644
index 0000000..176a458
--- /dev/null
+++ b/node_modules/ansi-styles/.gitattributes
@@ -0,0 +1 @@
+* text=auto
diff --git a/node_modules/ansi-styles/.gitignore b/node_modules/ansi-styles/.gitignore
new file mode 100644
index 0000000..3c3629e
--- /dev/null
+++ b/node_modules/ansi-styles/.gitignore
@@ -0,0 +1 @@
+node_modules
diff --git a/.jshintrc b/node_modules/ansi-styles/.jshintrc
similarity index 100%
copy from .jshintrc
copy to node_modules/ansi-styles/.jshintrc
diff --git a/node_modules/ansi-styles/.travis.yml b/node_modules/ansi-styles/.travis.yml
new file mode 100644
index 0000000..244b7e8
--- /dev/null
+++ b/node_modules/ansi-styles/.travis.yml
@@ -0,0 +1,3 @@
+language: node_js
+node_js:
+ - '0.10'
diff --git a/node_modules/ansi-styles/index.js b/node_modules/ansi-styles/index.js
new file mode 100644
index 0000000..2d8b472
--- /dev/null
+++ b/node_modules/ansi-styles/index.js
@@ -0,0 +1,40 @@
+'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
new file mode 100644
index 0000000..654d0bf
--- /dev/null
+++ b/node_modules/ansi-styles/license
@@ -0,0 +1,21 @@
+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
new file mode 100644
index 0000000..a9ba607
--- /dev/null
+++ b/node_modules/ansi-styles/package.json
@@ -0,0 +1,46 @@
+{
+ "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
new file mode 100644
index 0000000..73584cc
--- /dev/null
+++ b/node_modules/ansi-styles/readme.md
@@ -0,0 +1,70 @@
+# ansi-styles [](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.
+
+
+
+
+## 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
new file mode 100644
index 0000000..ec618af
Binary files /dev/null and b/node_modules/ansi-styles/screenshot.png differ
diff --git a/node_modules/ansi-styles/test.js b/node_modules/ansi-styles/test.js
new file mode 100644
index 0000000..f030ca7
--- /dev/null
+++ b/node_modules/ansi-styles/test.js
@@ -0,0 +1,26 @@
+'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
new file mode 100644
index 0000000..8311fe1
--- /dev/null
+++ b/node_modules/escape-string-regexp/.editorconfig
@@ -0,0 +1,16 @@
+# 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
new file mode 100644
index 0000000..176a458
--- /dev/null
+++ b/node_modules/escape-string-regexp/.gitattributes
@@ -0,0 +1 @@
+* text=auto
diff --git a/node_modules/escape-string-regexp/.gitignore b/node_modules/escape-string-regexp/.gitignore
new file mode 100644
index 0000000..3c3629e
--- /dev/null
+++ b/node_modules/escape-string-regexp/.gitignore
@@ -0,0 +1 @@
+node_modules
diff --git a/.jshintrc b/node_modules/escape-string-regexp/.jshintrc
similarity index 77%
copy from .jshintrc
copy to node_modules/escape-string-regexp/.jshintrc
index c511975..804f8af 100644
--- a/.jshintrc
+++ b/node_modules/escape-string-regexp/.jshintrc
@@ -4,12 +4,9 @@
"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/escape-string-regexp/.travis.yml b/node_modules/escape-string-regexp/.travis.yml
new file mode 100644
index 0000000..244b7e8
--- /dev/null
+++ b/node_modules/escape-string-regexp/.travis.yml
@@ -0,0 +1,3 @@
+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
new file mode 100644
index 0000000..ac6572c
--- /dev/null
+++ b/node_modules/escape-string-regexp/index.js
@@ -0,0 +1,11 @@
+'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
new file mode 100644
index 0000000..654d0bf
--- /dev/null
+++ b/node_modules/escape-string-regexp/license
@@ -0,0 +1,21 @@
+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
new file mode 100644
index 0000000..8da659f
--- /dev/null
+++ b/node_modules/escape-string-regexp/package.json
@@ -0,0 +1,36 @@
+{
+ "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
new file mode 100644
index 0000000..808a963
--- /dev/null
+++ b/node_modules/escape-string-regexp/readme.md
@@ -0,0 +1,27 @@
+# escape-string-regexp [](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
new file mode 100644
index 0000000..f968b71
--- /dev/null
+++ b/node_modules/escape-string-regexp/test.js
@@ -0,0 +1,7 @@
+'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
new file mode 100644
index 0000000..8311fe1
--- /dev/null
+++ b/node_modules/has-ansi/.editorconfig
@@ -0,0 +1,16 @@
+# 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
new file mode 100644
index 0000000..176a458
--- /dev/null
+++ b/node_modules/has-ansi/.gitattributes
@@ -0,0 +1 @@
+* text=auto
diff --git a/node_modules/has-ansi/.gitignore b/node_modules/has-ansi/.gitignore
new file mode 100644
index 0000000..3c3629e
--- /dev/null
+++ b/node_modules/has-ansi/.gitignore
@@ -0,0 +1 @@
+node_modules
diff --git a/.jshintrc b/node_modules/has-ansi/.jshintrc
similarity index 77%
copy from .jshintrc
copy to node_modules/has-ansi/.jshintrc
index c511975..804f8af 100644
--- a/.jshintrc
+++ b/node_modules/has-ansi/.jshintrc
@@ -4,12 +4,9 @@
"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/has-ansi/.travis.yml b/node_modules/has-ansi/.travis.yml
new file mode 100644
index 0000000..244b7e8
--- /dev/null
+++ b/node_modules/has-ansi/.travis.yml
@@ -0,0 +1,3 @@
+language: node_js
+node_js:
+ - '0.10'
diff --git a/node_modules/has-ansi/cli.js b/node_modules/has-ansi/cli.js
new file mode 100755
index 0000000..e0956fc
--- /dev/null
+++ b/node_modules/has-ansi/cli.js
@@ -0,0 +1,53 @@
+#!/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
new file mode 100644
index 0000000..98fae06
--- /dev/null
+++ b/node_modules/has-ansi/index.js
@@ -0,0 +1,4 @@
+'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
new file mode 100644
index 0000000..654d0bf
--- /dev/null
+++ b/node_modules/has-ansi/license
@@ -0,0 +1,21 @@
+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
new file mode 100644
index 0000000..047ff0d
--- /dev/null
+++ b/node_modules/has-ansi/package.json
@@ -0,0 +1,57 @@
+{
+ "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
new file mode 100644
index 0000000..0702212
--- /dev/null
+++ b/node_modules/has-ansi/readme.md
@@ -0,0 +1,45 @@
+# has-ansi [](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
new file mode 100644
index 0000000..941138b
--- /dev/null
+++ b/node_modules/has-ansi/test.js
@@ -0,0 +1,8 @@
+'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
new file mode 100644
index 0000000..8311fe1
--- /dev/null
+++ b/node_modules/strip-ansi/.editorconfig
@@ -0,0 +1,16 @@
+# 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
new file mode 100644
index 0000000..176a458
--- /dev/null
+++ b/node_modules/strip-ansi/.gitattributes
@@ -0,0 +1 @@
+* text=auto
diff --git a/node_modules/strip-ansi/.gitignore b/node_modules/strip-ansi/.gitignore
new file mode 100644
index 0000000..3c3629e
--- /dev/null
+++ b/node_modules/strip-ansi/.gitignore
@@ -0,0 +1 @@
+node_modules
diff --git a/.jshintrc b/node_modules/strip-ansi/.jshintrc
similarity index 100%
copy from .jshintrc
copy to node_modules/strip-ansi/.jshintrc
diff --git a/node_modules/strip-ansi/.travis.yml b/node_modules/strip-ansi/.travis.yml
new file mode 100644
index 0000000..244b7e8
--- /dev/null
+++ b/node_modules/strip-ansi/.travis.yml
@@ -0,0 +1,3 @@
+language: node_js
+node_js:
+ - '0.10'
diff --git a/node_modules/strip-ansi/cli.js b/node_modules/strip-ansi/cli.js
new file mode 100755
index 0000000..602ae00
--- /dev/null
+++ b/node_modules/strip-ansi/cli.js
@@ -0,0 +1,39 @@
+#!/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
new file mode 100644
index 0000000..099480f
--- /dev/null
+++ b/node_modules/strip-ansi/index.js
@@ -0,0 +1,6 @@
+'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
new file mode 100644
index 0000000..654d0bf
--- /dev/null
+++ b/node_modules/strip-ansi/license
@@ -0,0 +1,21 @@
+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
new file mode 100644
index 0000000..4f355f9
--- /dev/null
+++ b/node_modules/strip-ansi/package.json
@@ -0,0 +1,56 @@
+{
+ "name": "strip-ansi",
+ "version": "1.0.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
new file mode 100644
index 0000000..5477079
--- /dev/null
+++ b/node_modules/strip-ansi/readme.md
@@ -0,0 +1,43 @@
+# strip-ansi [](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
new file mode 100644
index 0000000..f7f456e
--- /dev/null
+++ b/node_modules/strip-ansi/test.js
@@ -0,0 +1,23 @@
+'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
new file mode 100644
index 0000000..8311fe1
--- /dev/null
+++ b/node_modules/supports-color/.editorconfig
@@ -0,0 +1,16 @@
+# 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
new file mode 100644
index 0000000..176a458
--- /dev/null
+++ b/node_modules/supports-color/.gitattributes
@@ -0,0 +1 @@
+* text=auto
diff --git a/node_modules/supports-color/.gitignore b/node_modules/supports-color/.gitignore
new file mode 100644
index 0000000..3c3629e
--- /dev/null
+++ b/node_modules/supports-color/.gitignore
@@ -0,0 +1 @@
+node_modules
diff --git a/.jshintrc b/node_modules/supports-color/.jshintrc
similarity index 77%
copy from .jshintrc
copy to node_modules/supports-color/.jshintrc
index c511975..804f8af 100644
--- a/.jshintrc
+++ b/node_modules/supports-color/.jshintrc
@@ -4,12 +4,9 @@
"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/supports-color/.travis.yml b/node_modules/supports-color/.travis.yml
new file mode 100644
index 0000000..244b7e8
--- /dev/null
+++ b/node_modules/supports-color/.travis.yml
@@ -0,0 +1,3 @@
+language: node_js
+node_js:
+ - '0.10'
diff --git a/node_modules/supports-color/cli.js b/node_modules/supports-color/cli.js
new file mode 100755
index 0000000..0617971
--- /dev/null
+++ b/node_modules/supports-color/cli.js
@@ -0,0 +1,28 @@
+#!/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
new file mode 100644
index 0000000..092d0ba
--- /dev/null
+++ b/node_modules/supports-color/index.js
@@ -0,0 +1,32 @@
+'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
new file mode 100644
index 0000000..654d0bf
--- /dev/null
+++ b/node_modules/supports-color/license
@@ -0,0 +1,21 @@
+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
new file mode 100644
index 0000000..02b0197
--- /dev/null
+++ b/node_modules/supports-color/package.json
@@ -0,0 +1,50 @@
+{
+ "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
new file mode 100644
index 0000000..7f07e5f
--- /dev/null
+++ b/node_modules/supports-color/readme.md
@@ -0,0 +1,44 @@
+# supports-color [](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
new file mode 100644
index 0000000..4c5c1e8
--- /dev/null
+++ b/node_modules/supports-color/test.js
@@ -0,0 +1,30 @@
+'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 7a94654..e58fe48 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "chalk",
- "version": "0.5.0",
+ "version": "0.5.1",
"description": "Terminal string styling done right. Created because the `colors` module does some really horrible things.",
"license": "MIT",
"repository": "sindresorhus/chalk",
diff --git a/test.js b/test.js
index 5d588d4..3e073a6 100644
--- a/test.js
+++ b/test.js
@@ -32,6 +32,17 @@ describe('chalk', 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');
});
+ it('should be able to cache multiple styles', function() {
+ var red = chalk.red;
+ var blue = chalk.blue;
+ var redBold = red.bold;
+ var blueBold = blue.bold;
+
+ assert.notEqual(red('foo'), blue('foo'));
+ assert.notEqual(redBold('bar'), blueBold('bar'));
+ assert.notEqual(blue('baz'), blueBold('baz'));
+ });
+
it('should alias gray to grey', function () {
assert.equal(chalk.grey('foo'), '\u001b[90mfoo\u001b[39m');
});
--
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