aboutsummaryrefslogtreecommitdiff
path: root/node_modules/supports-color
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2016-11-03 01:33:53 +0100
committerFlorian Dold <florian.dold@gmail.com>2016-11-03 01:33:53 +0100
commitd1291f67551c58168af43698a359cb5ddfd266b0 (patch)
tree55a13ed29fe1915e3f42f1b1b7038dafa2e975a7 /node_modules/supports-color
parentd0a0695fb5d34996850723f7d4b1b59c3df909c2 (diff)
downloadwallet-core-d1291f67551c58168af43698a359cb5ddfd266b0.tar.xz
node_modules
Diffstat (limited to 'node_modules/supports-color')
-rwxr-xr-xnode_modules/supports-color/cli.js29
-rw-r--r--node_modules/supports-color/index.js25
-rw-r--r--node_modules/supports-color/license21
-rw-r--r--node_modules/supports-color/package.json102
-rw-r--r--node_modules/supports-color/readme.md20
5 files changed, 70 insertions, 127 deletions
diff --git a/node_modules/supports-color/cli.js b/node_modules/supports-color/cli.js
new file mode 100755
index 000000000..e74698766
--- /dev/null
+++ b/node_modules/supports-color/cli.js
@@ -0,0 +1,29 @@
+#!/usr/bin/env node
+'use strict';
+var pkg = require('./package.json');
+var supportsColor = require('./');
+var argv = process.argv.slice(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 (argv.indexOf('--help') !== -1) {
+ help();
+ return;
+}
+
+if (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
index 4346e272e..a2b978450 100644
--- a/node_modules/supports-color/index.js
+++ b/node_modules/supports-color/index.js
@@ -1,28 +1,17 @@
'use strict';
var argv = process.argv;
-var terminator = argv.indexOf('--');
-var hasFlag = function (flag) {
- flag = '--' + flag;
- var pos = argv.indexOf(flag);
- return pos !== -1 && (terminator !== -1 ? pos < terminator : true);
-};
-
module.exports = (function () {
- if ('FORCE_COLOR' in process.env) {
- return true;
- }
-
- if (hasFlag('no-color') ||
- hasFlag('no-colors') ||
- hasFlag('color=false')) {
+ if (argv.indexOf('--no-color') !== -1 ||
+ argv.indexOf('--no-colors') !== -1 ||
+ argv.indexOf('--color=false') !== -1) {
return false;
}
- if (hasFlag('color') ||
- hasFlag('colors') ||
- hasFlag('color=true') ||
- hasFlag('color=always')) {
+ if (argv.indexOf('--color') !== -1 ||
+ argv.indexOf('--colors') !== -1 ||
+ argv.indexOf('--color=true') !== -1 ||
+ argv.indexOf('--color=always') !== -1) {
return true;
}
diff --git a/node_modules/supports-color/license b/node_modules/supports-color/license
deleted file mode 100644
index 654d0bfe9..000000000
--- a/node_modules/supports-color/license
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/node_modules/supports-color/package.json b/node_modules/supports-color/package.json
index 853a060f8..7f72e762a 100644
--- a/node_modules/supports-color/package.json
+++ b/node_modules/supports-color/package.json
@@ -1,74 +1,30 @@
{
- "_args": [
- [
- {
- "raw": "supports-color@^2.0.0",
- "scope": null,
- "escapedName": "supports-color",
- "name": "supports-color",
- "rawSpec": "^2.0.0",
- "spec": ">=2.0.0 <3.0.0",
- "type": "range"
- },
- "/home/dold/repos/taler/wallet-webex/node_modules/chalk"
- ]
- ],
- "_from": "supports-color@>=2.0.0 <3.0.0",
- "_id": "supports-color@2.0.0",
- "_inCache": true,
- "_location": "/supports-color",
- "_nodeVersion": "0.12.5",
- "_npmUser": {
- "name": "sindresorhus",
- "email": "sindresorhus@gmail.com"
- },
- "_npmVersion": "2.11.2",
- "_phantomChildren": {},
- "_requested": {
- "raw": "supports-color@^2.0.0",
- "scope": null,
- "escapedName": "supports-color",
- "name": "supports-color",
- "rawSpec": "^2.0.0",
- "spec": ">=2.0.0 <3.0.0",
- "type": "range"
- },
- "_requiredBy": [
- "/chalk"
- ],
- "_resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
- "_shasum": "535d045ce6b6363fa40117084629995e9df324c7",
- "_shrinkwrap": null,
- "_spec": "supports-color@^2.0.0",
- "_where": "/home/dold/repos/taler/wallet-webex/node_modules/chalk",
+ "name": "supports-color",
+ "version": "1.2.0",
+ "description": "Detect whether a terminal supports color",
+ "license": "MIT",
+ "repository": "sindresorhus/supports-color",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
- "url": "sindresorhus.com"
+ "url": "http://sindresorhus.com"
},
- "bugs": {
- "url": "https://github.com/chalk/supports-color/issues"
- },
- "dependencies": {},
- "description": "Detect whether a terminal supports color",
- "devDependencies": {
- "mocha": "*",
- "require-uncached": "^1.0.2"
- },
- "directories": {},
- "dist": {
- "shasum": "535d045ce6b6363fa40117084629995e9df324c7",
- "tarball": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz"
+ "bin": {
+ "supports-color": "cli.js"
},
"engines": {
- "node": ">=0.8.0"
+ "node": ">=0.10.0"
+ },
+ "scripts": {
+ "test": "mocha"
},
"files": [
- "index.js"
+ "index.js",
+ "cli.js"
],
- "gitHead": "8400d98ade32b2adffd50902c06d9e725a5c6588",
- "homepage": "https://github.com/chalk/supports-color",
"keywords": [
+ "cli",
+ "bin",
"color",
"colour",
"colors",
@@ -88,26 +44,8 @@
"capability",
"detect"
],
- "license": "MIT",
- "maintainers": [
- {
- "name": "sindresorhus",
- "email": "sindresorhus@gmail.com"
- },
- {
- "name": "jbnicolai",
- "email": "jappelman@xebia.com"
- }
- ],
- "name": "supports-color",
- "optionalDependencies": {},
- "readme": "ERROR: No README data found!",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/chalk/supports-color.git"
- },
- "scripts": {
- "test": "mocha"
- },
- "version": "2.0.0"
+ "devDependencies": {
+ "mocha": "*",
+ "require-uncached": "^1.0.2"
+ }
}
diff --git a/node_modules/supports-color/readme.md b/node_modules/supports-color/readme.md
index b4761f1ec..32d4f46e9 100644
--- a/node_modules/supports-color/readme.md
+++ b/node_modules/supports-color/readme.md
@@ -1,11 +1,11 @@
-# supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color)
+# 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
```
@@ -22,13 +22,21 @@ if (supportsColor) {
It obeys the `--color` and `--no-color` CLI flags.
-For situations where using `--color` is not possible, add an environment variable `FORCE_COLOR` with any value to force color. Trumps `--no-color`.
+## CLI
+
+```sh
+$ npm install --global supports-color
+```
+
+```
+$ supports-color --help
-## Related
+ Usage
+ supports-color
-- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module
-- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
+ Exits with code 0 if color is supported and 1 if not
+```
## License