heroku-cli-util
Advanced tools
Comparing version 5.2.1 to 5.3.0
@@ -5,2 +5,3 @@ 'use strict'; | ||
var prompt = require('./lib/prompt'); | ||
var styled = require('./lib/styled'); | ||
@@ -25,1 +26,3 @@ exports.hush = console.hush; | ||
exports.stderr = ''; | ||
exports.styledHeader = styled.styledHeader; | ||
exports.styledHash = styled.styledHash; |
@@ -8,2 +8,3 @@ 'use strict'; | ||
var defineProps = Object.defineProperties; | ||
var isSimpleWindowsTerm = process.platform === 'win32' && !/^xterm/i.test(process.env.TERM); | ||
@@ -16,18 +17,6 @@ function Chalk(options) { | ||
// use bright blue on Windows as the normal blue color is illegible | ||
if (process.platform === 'win32') { | ||
if (isSimpleWindowsTerm) { | ||
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; | ||
return builder; | ||
} | ||
var styles = (function () { | ||
@@ -51,2 +40,17 @@ var ret = {}; | ||
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. | ||
/*eslint no-proto: 0 */ | ||
builder.__proto__ = proto; | ||
return builder; | ||
} | ||
function applyStyle() { | ||
@@ -57,2 +61,3 @@ // support varags, but simply cast to string in case there's only one arg | ||
var str = argsLen !== 0 && String(arguments[0]); | ||
if (argsLen > 1) { | ||
@@ -69,8 +74,16 @@ // don't slice `arguments`, it prevents v8 optimizations | ||
/*jshint validthis: true */ | ||
var nestedStyles = this._styles; | ||
var i = nestedStyles.length; | ||
var i = nestedStyles.length; | ||
// Turns out that on Windows dimmed gray text becomes invisible in cmd.exe, | ||
// see https://github.com/chalk/chalk/issues/58 | ||
// If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop. | ||
var originalDim = ansiStyles.dim.open; | ||
if (isSimpleWindowsTerm && (nestedStyles.indexOf('gray') !== -1 || nestedStyles.indexOf('grey') !== -1)) { | ||
ansiStyles.dim.open = ''; | ||
} | ||
while (i--) { | ||
var code = ansiStyles[nestedStyles[i]]; | ||
// Replace any instances already present with a re-opening code | ||
@@ -82,2 +95,5 @@ // otherwise only the part of the string until said closing code | ||
// Reset the original 'dim' if we changed it to work around the Windows dimmed gray issue. | ||
ansiStyles.dim.open = originalDim; | ||
return str; | ||
@@ -84,0 +100,0 @@ } |
'use strict'; | ||
var styles = module.exports = { | ||
modifiers: { | ||
reset: [0, 0], | ||
bold: [1, 22], // 21 isn't widely supported and 22 does the same thing | ||
dim: [2, 22], | ||
italic: [3, 23], | ||
underline: [4, 24], | ||
inverse: [7, 27], | ||
hidden: [8, 28], | ||
strikethrough: [9, 29] | ||
}, | ||
colors: { | ||
black: [30, 39], | ||
red: [31, 39], | ||
green: [32, 39], | ||
yellow: [33, 39], | ||
blue: [34, 39], | ||
magenta: [35, 39], | ||
cyan: [36, 39], | ||
white: [37, 39], | ||
gray: [90, 39] | ||
}, | ||
bgColors: { | ||
bgBlack: [40, 49], | ||
bgRed: [41, 49], | ||
bgGreen: [42, 49], | ||
bgYellow: [43, 49], | ||
bgBlue: [44, 49], | ||
bgMagenta: [45, 49], | ||
bgCyan: [46, 49], | ||
bgWhite: [47, 49] | ||
} | ||
}; | ||
function assembleStyles () { | ||
var styles = { | ||
modifiers: { | ||
reset: [0, 0], | ||
bold: [1, 22], // 21 isn't widely supported and 22 does the same thing | ||
dim: [2, 22], | ||
italic: [3, 23], | ||
underline: [4, 24], | ||
inverse: [7, 27], | ||
hidden: [8, 28], | ||
strikethrough: [9, 29] | ||
}, | ||
colors: { | ||
black: [30, 39], | ||
red: [31, 39], | ||
green: [32, 39], | ||
yellow: [33, 39], | ||
blue: [34, 39], | ||
magenta: [35, 39], | ||
cyan: [36, 39], | ||
white: [37, 39], | ||
gray: [90, 39] | ||
}, | ||
bgColors: { | ||
bgBlack: [40, 49], | ||
bgRed: [41, 49], | ||
bgGreen: [42, 49], | ||
bgYellow: [43, 49], | ||
bgBlue: [44, 49], | ||
bgMagenta: [45, 49], | ||
bgCyan: [46, 49], | ||
bgWhite: [47, 49] | ||
} | ||
}; | ||
// fix humans | ||
styles.colors.grey = styles.colors.gray; | ||
// fix humans | ||
styles.colors.grey = styles.colors.gray; | ||
Object.keys(styles).forEach(function (groupName) { | ||
var group = styles[groupName]; | ||
Object.keys(styles).forEach(function (groupName) { | ||
var group = styles[groupName]; | ||
Object.keys(group).forEach(function (styleName) { | ||
var style = group[styleName]; | ||
Object.keys(group).forEach(function (styleName) { | ||
var style = group[styleName]; | ||
styles[styleName] = group[styleName] = { | ||
open: '\u001b[' + style[0] + 'm', | ||
close: '\u001b[' + style[1] + 'm' | ||
}; | ||
styles[styleName] = group[styleName] = { | ||
open: '\u001b[' + style[0] + 'm', | ||
close: '\u001b[' + style[1] + 'm' | ||
}; | ||
}); | ||
Object.defineProperty(styles, groupName, { | ||
value: group, | ||
enumerable: false | ||
}); | ||
}); | ||
Object.defineProperty(styles, groupName, { | ||
value: group, | ||
enumerable: false | ||
}); | ||
return styles; | ||
} | ||
Object.defineProperty(module, 'exports', { | ||
enumerable: true, | ||
get: assembleStyles | ||
}); |
{ | ||
"name": "ansi-styles", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"description": "ANSI escape codes for styling strings in the terminal", | ||
@@ -8,3 +8,3 @@ "license": "MIT", | ||
"type": "git", | ||
"url": "git+https://github.com/sindresorhus/ansi-styles.git" | ||
"url": "https://github.com/chalk/ansi-styles" | ||
}, | ||
@@ -14,3 +14,3 @@ "author": { | ||
"email": "sindresorhus@gmail.com", | ||
"url": "http://sindresorhus.com" | ||
"url": "sindresorhus.com" | ||
}, | ||
@@ -61,12 +61,12 @@ "maintainers": [ | ||
}, | ||
"gitHead": "da6541334e1681cb803f891fab8abf4313cc4bc1", | ||
"gitHead": "18421cbe4a2d93359ec2599a894f704be126d066", | ||
"bugs": { | ||
"url": "https://github.com/sindresorhus/ansi-styles/issues" | ||
"url": "https://github.com/chalk/ansi-styles/issues" | ||
}, | ||
"homepage": "https://github.com/sindresorhus/ansi-styles", | ||
"_id": "ansi-styles@2.0.1", | ||
"_shasum": "b033f57f93e2d28adeb8bc11138fa13da0fd20a3", | ||
"_from": "ansi-styles@>=2.0.1 <3.0.0", | ||
"_npmVersion": "2.1.16", | ||
"_nodeVersion": "0.10.35", | ||
"homepage": "https://github.com/chalk/ansi-styles", | ||
"_id": "ansi-styles@2.1.0", | ||
"_shasum": "990f747146927b559a932bf92959163d60c0d0e2", | ||
"_from": "ansi-styles@>=2.1.0 <3.0.0", | ||
"_npmVersion": "2.10.1", | ||
"_nodeVersion": "0.12.4", | ||
"_npmUser": { | ||
@@ -77,8 +77,7 @@ "name": "jbnicolai", | ||
"dist": { | ||
"shasum": "b033f57f93e2d28adeb8bc11138fa13da0fd20a3", | ||
"tarball": "http://registry.npmjs.org/ansi-styles/-/ansi-styles-2.0.1.tgz" | ||
"shasum": "990f747146927b559a932bf92959163d60c0d0e2", | ||
"tarball": "http://registry.npmjs.org/ansi-styles/-/ansi-styles-2.1.0.tgz" | ||
}, | ||
"directories": {}, | ||
"_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.0.1.tgz", | ||
"readme": "ERROR: No README data found!" | ||
"_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.1.0.tgz" | ||
} |
@@ -1,6 +0,6 @@ | ||
# ansi-styles [![Build Status](https://travis-ci.org/sindresorhus/ansi-styles.svg?branch=master)](https://travis-ci.org/sindresorhus/ansi-styles) | ||
# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles) | ||
> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal | ||
You probably want the higher-level [chalk](https://github.com/sindresorhus/chalk) module for styling your strings. | ||
You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. | ||
@@ -12,3 +12,3 @@ ![](screenshot.png) | ||
```sh | ||
``` | ||
$ npm install --save ansi-styles | ||
@@ -15,0 +15,0 @@ ``` |
@@ -65,7 +65,7 @@ { | ||
"shasum": "9e2d8b25bc2555c3336723750e03f099c2735bb5", | ||
"tarball": "http://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.3.tgz" | ||
"tarball": "http://heroku-npm.herokuapp.com/escape-string-regexp/-/escape-string-regexp-1.0.3.tgz" | ||
}, | ||
"directories": {}, | ||
"_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.3.tgz", | ||
"_resolved": "https://heroku-npm.herokuapp.com/escape-string-regexp/-/escape-string-regexp-1.0.3.tgz", | ||
"readme": "ERROR: No README data found!" | ||
} |
'use strict'; | ||
module.exports = function () { | ||
return /(?:(?:\u001b\[)|\u009b)(?:(?:[0-9]{1,3})?(?:(?:;[0-9]{0,3})*)?[A-M|f-m])|\u001b[A-M]/g; | ||
return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g; | ||
}; |
{ | ||
"name": "ansi-regex", | ||
"version": "1.1.1", | ||
"version": "2.0.0", | ||
"description": "Regular expression for matching ANSI escape codes", | ||
@@ -8,3 +8,3 @@ "license": "MIT", | ||
"type": "git", | ||
"url": "git+https://github.com/sindresorhus/ansi-regex.git" | ||
"url": "https://github.com/sindresorhus/ansi-regex" | ||
}, | ||
@@ -14,3 +14,3 @@ "author": { | ||
"email": "sindresorhus@gmail.com", | ||
"url": "http://sindresorhus.com" | ||
"url": "sindresorhus.com" | ||
}, | ||
@@ -67,3 +67,3 @@ "maintainers": [ | ||
}, | ||
"gitHead": "47fb974630af70998157b30fad6eb5e5bd7c7cd6", | ||
"gitHead": "57c3f2941a73079fa8b081e02a522e3d29913e2f", | ||
"bugs": { | ||
@@ -73,18 +73,17 @@ "url": "https://github.com/sindresorhus/ansi-regex/issues" | ||
"homepage": "https://github.com/sindresorhus/ansi-regex", | ||
"_id": "ansi-regex@1.1.1", | ||
"_shasum": "41c847194646375e6a1a5d10c3ca054ef9fc980d", | ||
"_from": "ansi-regex@>=1.1.0 <2.0.0", | ||
"_npmVersion": "2.1.16", | ||
"_nodeVersion": "0.10.35", | ||
"_id": "ansi-regex@2.0.0", | ||
"_shasum": "c5061b6e0ef8a81775e50f5d66151bf6bf371107", | ||
"_from": "ansi-regex@>=2.0.0 <3.0.0", | ||
"_npmVersion": "2.11.2", | ||
"_nodeVersion": "0.12.5", | ||
"_npmUser": { | ||
"name": "jbnicolai", | ||
"email": "jappelman@xebia.com" | ||
"name": "sindresorhus", | ||
"email": "sindresorhus@gmail.com" | ||
}, | ||
"dist": { | ||
"shasum": "41c847194646375e6a1a5d10c3ca054ef9fc980d", | ||
"tarball": "http://registry.npmjs.org/ansi-regex/-/ansi-regex-1.1.1.tgz" | ||
"shasum": "c5061b6e0ef8a81775e50f5d66151bf6bf371107", | ||
"tarball": "http://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz" | ||
}, | ||
"directories": {}, | ||
"_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-1.1.1.tgz", | ||
"readme": "ERROR: No README data found!" | ||
"_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz" | ||
} |
@@ -8,3 +8,3 @@ # ansi-regex [![Build Status](https://travis-ci.org/sindresorhus/ansi-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/ansi-regex) | ||
```sh | ||
``` | ||
$ npm install --save ansi-regex | ||
@@ -29,7 +29,5 @@ ``` | ||
*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) |
{ | ||
"name": "has-ansi", | ||
"version": "1.0.3", | ||
"version": "2.0.0", | ||
"description": "Check if a string has ANSI escape codes", | ||
@@ -8,3 +8,3 @@ "license": "MIT", | ||
"type": "git", | ||
"url": "git+https://github.com/sindresorhus/has-ansi.git" | ||
"url": "https://github.com/sindresorhus/has-ansi" | ||
}, | ||
@@ -14,3 +14,3 @@ "author": { | ||
"email": "sindresorhus@gmail.com", | ||
"url": "http://sindresorhus.com" | ||
"url": "sindresorhus.com" | ||
}, | ||
@@ -27,5 +27,2 @@ "maintainers": [ | ||
], | ||
"bin": { | ||
"has-ansi": "cli.js" | ||
}, | ||
"engines": { | ||
@@ -35,11 +32,8 @@ "node": ">=0.10.0" | ||
"scripts": { | ||
"test": "mocha" | ||
"test": "node test.js" | ||
}, | ||
"files": [ | ||
"index.js", | ||
"cli.js" | ||
"index.js" | ||
], | ||
"keywords": [ | ||
"cli", | ||
"bin", | ||
"ansi", | ||
@@ -69,9 +63,8 @@ "styles", | ||
"dependencies": { | ||
"ansi-regex": "^1.1.0", | ||
"get-stdin": "^4.0.1" | ||
"ansi-regex": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"mocha": "*" | ||
"ava": "0.0.4" | ||
}, | ||
"gitHead": "416428ed16f8e9718aec54cea083173af6019917", | ||
"gitHead": "0722275e1bef139fcd09137da6e5550c3cd368b9", | ||
"bugs": { | ||
@@ -81,18 +74,17 @@ "url": "https://github.com/sindresorhus/has-ansi/issues" | ||
"homepage": "https://github.com/sindresorhus/has-ansi", | ||
"_id": "has-ansi@1.0.3", | ||
"_shasum": "c0b5b1615d9e382b0ff67169d967b425e48ca538", | ||
"_from": "has-ansi@>=1.0.3 <2.0.0", | ||
"_npmVersion": "2.1.16", | ||
"_nodeVersion": "0.10.35", | ||
"_id": "has-ansi@2.0.0", | ||
"_shasum": "34f5049ce1ecdf2b0649af3ef24e45ed35416d91", | ||
"_from": "has-ansi@>=2.0.0 <3.0.0", | ||
"_npmVersion": "2.11.2", | ||
"_nodeVersion": "0.12.5", | ||
"_npmUser": { | ||
"name": "jbnicolai", | ||
"email": "jappelman@xebia.com" | ||
"name": "sindresorhus", | ||
"email": "sindresorhus@gmail.com" | ||
}, | ||
"dist": { | ||
"shasum": "c0b5b1615d9e382b0ff67169d967b425e48ca538", | ||
"tarball": "http://registry.npmjs.org/has-ansi/-/has-ansi-1.0.3.tgz" | ||
"shasum": "34f5049ce1ecdf2b0649af3ef24e45ed35416d91", | ||
"tarball": "http://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz" | ||
}, | ||
"directories": {}, | ||
"_resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-1.0.3.tgz", | ||
"readme": "ERROR: No README data found!" | ||
"_resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz" | ||
} |
@@ -8,3 +8,3 @@ # has-ansi [![Build Status](https://travis-ci.org/sindresorhus/has-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/has-ansi) | ||
```sh | ||
``` | ||
$ npm install --save has-ansi | ||
@@ -27,21 +27,12 @@ ``` | ||
## CLI | ||
## Related | ||
```sh | ||
$ npm install --global has-ansi | ||
``` | ||
- [has-ansi-cli](https://github.com/sindresorhus/has-ansi-cli) - CLI for this module | ||
- [strip-ansi](https://github.com/sindresorhus/strip-ansi) - Strip ANSI escape codes | ||
- [ansi-regex](https://github.com/sindresorhus/ansi-regex) - Regular expression for matching ANSI escape codes | ||
- [chalk](https://github.com/sindresorhus/chalk) - Terminal string styling done right | ||
``` | ||
$ 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) |
'use strict'; | ||
module.exports = function () { | ||
return /(?:(?:\u001b\[)|\u009b)(?:(?:[0-9]{1,3})?(?:(?:;[0-9]{0,3})*)?[A-M|f-m])|\u001b[A-M]/g; | ||
return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g; | ||
}; |
{ | ||
"name": "ansi-regex", | ||
"version": "1.1.1", | ||
"version": "2.0.0", | ||
"description": "Regular expression for matching ANSI escape codes", | ||
@@ -8,3 +8,3 @@ "license": "MIT", | ||
"type": "git", | ||
"url": "git+https://github.com/sindresorhus/ansi-regex.git" | ||
"url": "https://github.com/sindresorhus/ansi-regex" | ||
}, | ||
@@ -14,3 +14,3 @@ "author": { | ||
"email": "sindresorhus@gmail.com", | ||
"url": "http://sindresorhus.com" | ||
"url": "sindresorhus.com" | ||
}, | ||
@@ -67,3 +67,3 @@ "maintainers": [ | ||
}, | ||
"gitHead": "47fb974630af70998157b30fad6eb5e5bd7c7cd6", | ||
"gitHead": "57c3f2941a73079fa8b081e02a522e3d29913e2f", | ||
"bugs": { | ||
@@ -73,18 +73,17 @@ "url": "https://github.com/sindresorhus/ansi-regex/issues" | ||
"homepage": "https://github.com/sindresorhus/ansi-regex", | ||
"_id": "ansi-regex@1.1.1", | ||
"_shasum": "41c847194646375e6a1a5d10c3ca054ef9fc980d", | ||
"_from": "ansi-regex@>=1.1.0 <2.0.0", | ||
"_npmVersion": "2.1.16", | ||
"_nodeVersion": "0.10.35", | ||
"_id": "ansi-regex@2.0.0", | ||
"_shasum": "c5061b6e0ef8a81775e50f5d66151bf6bf371107", | ||
"_from": "ansi-regex@>=2.0.0 <3.0.0", | ||
"_npmVersion": "2.11.2", | ||
"_nodeVersion": "0.12.5", | ||
"_npmUser": { | ||
"name": "jbnicolai", | ||
"email": "jappelman@xebia.com" | ||
"name": "sindresorhus", | ||
"email": "sindresorhus@gmail.com" | ||
}, | ||
"dist": { | ||
"shasum": "41c847194646375e6a1a5d10c3ca054ef9fc980d", | ||
"tarball": "http://registry.npmjs.org/ansi-regex/-/ansi-regex-1.1.1.tgz" | ||
"shasum": "c5061b6e0ef8a81775e50f5d66151bf6bf371107", | ||
"tarball": "http://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz" | ||
}, | ||
"directories": {}, | ||
"_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-1.1.1.tgz", | ||
"readme": "ERROR: No README data found!" | ||
"_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz" | ||
} |
@@ -8,3 +8,3 @@ # ansi-regex [![Build Status](https://travis-ci.org/sindresorhus/ansi-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/ansi-regex) | ||
```sh | ||
``` | ||
$ npm install --save ansi-regex | ||
@@ -29,7 +29,5 @@ ``` | ||
*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) |
{ | ||
"name": "strip-ansi", | ||
"version": "2.0.1", | ||
"version": "3.0.0", | ||
"description": "Strip ANSI escape codes", | ||
@@ -8,3 +8,3 @@ "license": "MIT", | ||
"type": "git", | ||
"url": "git+https://github.com/sindresorhus/strip-ansi.git" | ||
"url": "https://github.com/sindresorhus/strip-ansi" | ||
}, | ||
@@ -14,7 +14,14 @@ "author": { | ||
"email": "sindresorhus@gmail.com", | ||
"url": "http://sindresorhus.com" | ||
"url": "sindresorhus.com" | ||
}, | ||
"bin": { | ||
"strip-ansi": "cli.js" | ||
}, | ||
"maintainers": [ | ||
{ | ||
"name": "sindresorhus", | ||
"email": "sindresorhus@gmail.com" | ||
}, | ||
{ | ||
"name": "jbnicolai", | ||
"email": "jappelman@xebia.com" | ||
} | ||
], | ||
"engines": { | ||
@@ -24,7 +31,6 @@ "node": ">=0.10.0" | ||
"scripts": { | ||
"test": "mocha" | ||
"test": "node test.js" | ||
}, | ||
"files": [ | ||
"index.js", | ||
"cli.js" | ||
"index.js" | ||
], | ||
@@ -42,3 +48,2 @@ "keywords": [ | ||
"console", | ||
"cli", | ||
"string", | ||
@@ -58,8 +63,8 @@ "tty", | ||
"dependencies": { | ||
"ansi-regex": "^1.0.0" | ||
"ansi-regex": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"mocha": "*" | ||
"ava": "0.0.4" | ||
}, | ||
"gitHead": "1eff0936c01f89efa312d9d51deed137259871a1", | ||
"gitHead": "3f05b9810e1438f946e2eb84ee854cc00b972e9e", | ||
"bugs": { | ||
@@ -69,6 +74,7 @@ "url": "https://github.com/sindresorhus/strip-ansi/issues" | ||
"homepage": "https://github.com/sindresorhus/strip-ansi", | ||
"_id": "strip-ansi@2.0.1", | ||
"_shasum": "df62c1aa94ed2f114e1d0f21fd1d50482b79a60e", | ||
"_from": "strip-ansi@>=2.0.1 <3.0.0", | ||
"_npmVersion": "1.4.28", | ||
"_id": "strip-ansi@3.0.0", | ||
"_shasum": "7510b665567ca914ccb5d7e072763ac968be3724", | ||
"_from": "strip-ansi@>=3.0.0 <4.0.0", | ||
"_npmVersion": "2.11.2", | ||
"_nodeVersion": "0.12.5", | ||
"_npmUser": { | ||
@@ -78,19 +84,8 @@ "name": "sindresorhus", | ||
}, | ||
"maintainers": [ | ||
{ | ||
"name": "sindresorhus", | ||
"email": "sindresorhus@gmail.com" | ||
}, | ||
{ | ||
"name": "jbnicolai", | ||
"email": "jappelman@xebia.com" | ||
} | ||
], | ||
"dist": { | ||
"shasum": "df62c1aa94ed2f114e1d0f21fd1d50482b79a60e", | ||
"tarball": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-2.0.1.tgz" | ||
"shasum": "7510b665567ca914ccb5d7e072763ac968be3724", | ||
"tarball": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.0.tgz" | ||
}, | ||
"directories": {}, | ||
"_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-2.0.1.tgz", | ||
"readme": "ERROR: No README data found!" | ||
"_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.0.tgz" | ||
} |
@@ -8,3 +8,3 @@ # strip-ansi [![Build Status](https://travis-ci.org/sindresorhus/strip-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-ansi) | ||
```sh | ||
``` | ||
$ npm install --save strip-ansi | ||
@@ -24,22 +24,12 @@ ``` | ||
## CLI | ||
## Related | ||
```sh | ||
$ npm install --global strip-ansi | ||
``` | ||
- [strip-ansi-cli](https://github.com/sindresorhus/strip-ansi-cli) - CLI for this module | ||
- [has-ansi](https://github.com/sindresorhus/has-ansi) - Check if a string has ANSI escape codes | ||
- [ansi-regex](https://github.com/sindresorhus/ansi-regex) - Regular expression for matching ANSI escape codes | ||
- [chalk](https://github.com/sindresorhus/chalk) - Terminal string styling done right | ||
```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) |
'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 () { | ||
@@ -9,12 +16,12 @@ if ('FORCE_COLOR' in process.env) { | ||
if (argv.indexOf('--no-color') !== -1 || | ||
argv.indexOf('--no-colors') !== -1 || | ||
argv.indexOf('--color=false') !== -1) { | ||
if (hasFlag('no-color') || | ||
hasFlag('no-colors') || | ||
hasFlag('color=false')) { | ||
return false; | ||
} | ||
if (argv.indexOf('--color') !== -1 || | ||
argv.indexOf('--colors') !== -1 || | ||
argv.indexOf('--color=true') !== -1 || | ||
argv.indexOf('--color=always') !== -1) { | ||
if (hasFlag('color') || | ||
hasFlag('colors') || | ||
hasFlag('color=true') || | ||
hasFlag('color=always')) { | ||
return true; | ||
@@ -21,0 +28,0 @@ } |
{ | ||
"name": "supports-color", | ||
"version": "1.3.1", | ||
"version": "2.0.0", | ||
"description": "Detect whether a terminal supports color", | ||
@@ -8,3 +8,3 @@ "license": "MIT", | ||
"type": "git", | ||
"url": "git+https://github.com/sindresorhus/supports-color.git" | ||
"url": "https://github.com/chalk/supports-color" | ||
}, | ||
@@ -26,5 +26,2 @@ "author": { | ||
], | ||
"bin": { | ||
"supports-color": "cli.js" | ||
}, | ||
"engines": { | ||
@@ -37,8 +34,5 @@ "node": ">=0.8.0" | ||
"files": [ | ||
"index.js", | ||
"cli.js" | ||
"index.js" | ||
], | ||
"keywords": [ | ||
"cli", | ||
"bin", | ||
"color", | ||
@@ -67,12 +61,12 @@ "colour", | ||
}, | ||
"gitHead": "09f1b4c336cee7269b4c8b3a8880054a23fcb35e", | ||
"gitHead": "8400d98ade32b2adffd50902c06d9e725a5c6588", | ||
"bugs": { | ||
"url": "https://github.com/sindresorhus/supports-color/issues" | ||
"url": "https://github.com/chalk/supports-color/issues" | ||
}, | ||
"homepage": "https://github.com/sindresorhus/supports-color", | ||
"_id": "supports-color@1.3.1", | ||
"_shasum": "15758df09d8ff3b4acc307539fabe27095e1042d", | ||
"_from": "supports-color@>=1.3.0 <2.0.0", | ||
"_npmVersion": "2.5.1", | ||
"_nodeVersion": "0.12.0", | ||
"homepage": "https://github.com/chalk/supports-color", | ||
"_id": "supports-color@2.0.0", | ||
"_shasum": "535d045ce6b6363fa40117084629995e9df324c7", | ||
"_from": "supports-color@>=2.0.0 <3.0.0", | ||
"_npmVersion": "2.11.2", | ||
"_nodeVersion": "0.12.5", | ||
"_npmUser": { | ||
@@ -83,8 +77,7 @@ "name": "sindresorhus", | ||
"dist": { | ||
"shasum": "15758df09d8ff3b4acc307539fabe27095e1042d", | ||
"tarball": "http://registry.npmjs.org/supports-color/-/supports-color-1.3.1.tgz" | ||
"shasum": "535d045ce6b6363fa40117084629995e9df324c7", | ||
"tarball": "http://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz" | ||
}, | ||
"directories": {}, | ||
"_resolved": "https://registry.npmjs.org/supports-color/-/supports-color-1.3.1.tgz", | ||
"readme": "ERROR: No README data found!" | ||
"_resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz" | ||
} |
@@ -1,2 +0,2 @@ | ||
# supports-color [![Build Status](https://travis-ci.org/sindresorhus/supports-color.svg?branch=master)](https://travis-ci.org/sindresorhus/supports-color) | ||
# supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color) | ||
@@ -28,20 +28,10 @@ > Detect whether a terminal supports color | ||
## CLI | ||
## Related | ||
``` | ||
$ npm install --global 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 | ||
``` | ||
$ 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) |
{ | ||
"name": "chalk", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Terminal string styling done right. Much color.", | ||
@@ -8,3 +8,3 @@ "license": "MIT", | ||
"type": "git", | ||
"url": "git+https://github.com/sindresorhus/chalk.git" | ||
"url": "https://github.com/chalk/chalk" | ||
}, | ||
@@ -19,2 +19,6 @@ "maintainers": [ | ||
"email": "jappelman@xebia.com" | ||
}, | ||
{ | ||
"name": "unicorn", | ||
"email": "sindresorhus+unicorn@gmail.com" | ||
} | ||
@@ -27,3 +31,5 @@ ], | ||
"test": "mocha", | ||
"bench": "matcha benchmark.js" | ||
"bench": "matcha benchmark.js", | ||
"coverage": "nyc npm test && nyc report", | ||
"coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls" | ||
}, | ||
@@ -41,3 +47,5 @@ "files": [ | ||
"string", | ||
"str", | ||
"ansi", | ||
"style", | ||
"styles", | ||
@@ -56,33 +64,37 @@ "tty", | ||
"dependencies": { | ||
"ansi-styles": "^2.0.1", | ||
"ansi-styles": "^2.1.0", | ||
"escape-string-regexp": "^1.0.2", | ||
"has-ansi": "^1.0.3", | ||
"strip-ansi": "^2.0.1", | ||
"supports-color": "^1.3.0" | ||
"has-ansi": "^2.0.0", | ||
"strip-ansi": "^3.0.0", | ||
"supports-color": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"coveralls": "^2.11.2", | ||
"matcha": "^0.6.0", | ||
"mocha": "*" | ||
"mocha": "*", | ||
"nyc": "^3.0.0", | ||
"require-uncached": "^1.0.2", | ||
"resolve-from": "^1.0.0", | ||
"semver": "^4.3.3" | ||
}, | ||
"gitHead": "8864d3563313ed15574a38dd5c9d5966080c46ce", | ||
"gitHead": "e9bb6e6000b1c5d4508afabfdc85dd70f582f515", | ||
"bugs": { | ||
"url": "https://github.com/sindresorhus/chalk/issues" | ||
"url": "https://github.com/chalk/chalk/issues" | ||
}, | ||
"homepage": "https://github.com/sindresorhus/chalk", | ||
"_id": "chalk@1.0.0", | ||
"_shasum": "b3cf4ed0ff5397c99c75b8f679db2f52831f96dc", | ||
"_from": "chalk@>=1.0.0 <2.0.0", | ||
"_npmVersion": "2.5.1", | ||
"_nodeVersion": "0.12.0", | ||
"homepage": "https://github.com/chalk/chalk", | ||
"_id": "chalk@1.1.0", | ||
"_shasum": "09b453cec497a75520e4a60ae48214a8700e0921", | ||
"_from": "chalk@1.1.0", | ||
"_npmVersion": "2.10.1", | ||
"_nodeVersion": "0.12.4", | ||
"_npmUser": { | ||
"name": "sindresorhus", | ||
"email": "sindresorhus@gmail.com" | ||
"name": "jbnicolai", | ||
"email": "jappelman@xebia.com" | ||
}, | ||
"dist": { | ||
"shasum": "b3cf4ed0ff5397c99c75b8f679db2f52831f96dc", | ||
"tarball": "http://registry.npmjs.org/chalk/-/chalk-1.0.0.tgz" | ||
"shasum": "09b453cec497a75520e4a60ae48214a8700e0921", | ||
"tarball": "http://registry.npmjs.org/chalk/-/chalk-1.1.0.tgz" | ||
}, | ||
"directories": {}, | ||
"_resolved": "https://registry.npmjs.org/chalk/-/chalk-1.0.0.tgz", | ||
"readme": "ERROR: No README data found!" | ||
"_resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.0.tgz" | ||
} |
<h1 align="center"> | ||
<br> | ||
<img width="360" src="https://cdn.rawgit.com/sindresorhus/chalk/19935d6484811c5e468817f846b7b3d417d7bf4a/logo.svg" alt="chalk"> | ||
<br> | ||
<img width="360" src="https://cdn.rawgit.com/chalk/chalk/19935d6484811c5e468817f846b7b3d417d7bf4a/logo.svg" alt="chalk"> | ||
<br> | ||
<br> | ||
<br> | ||
</h1> | ||
@@ -10,4 +12,7 @@ | ||
[![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) | ||
[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) | ||
[![Coverage Status](https://coveralls.io/repos/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/r/chalk/chalk?branch=master) | ||
[![](http://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) | ||
[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. | ||
@@ -17,3 +22,3 @@ | ||
![screenshot](https://github.com/sindresorhus/ansi-styles/raw/master/screenshot.png) | ||
![](https://github.com/chalk/ansi-styles/raw/master/screenshot.png) | ||
@@ -30,3 +35,3 @@ | ||
- Actively maintained | ||
- [Used by ~3000 modules](https://www.npmjs.com/browse/depended/chalk) | ||
- [Used by ~4000 modules](https://www.npmjs.com/browse/depended/chalk) as of May 24, 2015 | ||
@@ -110,3 +115,3 @@ | ||
Detect whether the terminal [supports color](https://github.com/sindresorhus/supports-color). Used internally and handled for you, but exposed for convenience. | ||
Detect whether the terminal [supports color](https://github.com/chalk/supports-color). Used internally and handled for you, but exposed for convenience. | ||
@@ -117,3 +122,3 @@ 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`. | ||
Exposes the styles as [ANSI escape codes](https://github.com/sindresorhus/ansi-styles). | ||
Exposes the styles as [ANSI escape codes](https://github.com/chalk/ansi-styles). | ||
@@ -133,7 +138,7 @@ Generally not useful, but you might need just the `.open` or `.close` escape code if you're mixing externally styled strings with your own. | ||
Check whether a string [has color](https://github.com/sindresorhus/has-ansi). | ||
Check whether a string [has color](https://github.com/chalk/has-ansi). | ||
### chalk.stripColor(string) | ||
[Strip color](https://github.com/sindresorhus/strip-ansi) from a string. | ||
[Strip color](https://github.com/chalk/strip-ansi) from a string. | ||
@@ -201,4 +206,14 @@ Can be useful in combination with `.supportsColor` to strip color on externally styled text when it's not supported. | ||
## Related | ||
- [chalk-cli](https://github.com/chalk/chalk-cli) - CLI for this module | ||
- [ansi-styles](https://github.com/chalk/ansi-styles/) - ANSI escape codes for styling strings in the terminal | ||
- [supports-color](https://github.com/chalk/supports-color/) - Detect whether a terminal supports color | ||
- [strip-ansi](https://github.com/chalk/strip-ansi) - Strip ANSI escape codes | ||
- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes | ||
- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes | ||
## License | ||
MIT © [Sindre Sorhus](http://sindresorhus.com) |
{ | ||
"name": "heroku-cli-util", | ||
"version": "5.2.1", | ||
"version": "5.3.0", | ||
"description": "Set of helpful CLI utilities", | ||
@@ -15,17 +15,16 @@ "main": "index.js", | ||
"test": "jshint . && mocha", | ||
"doc": "jsdoc lib", | ||
"changelog": "github-changes -o heroku -r heroku-cli-util --use-commit-body -k $GITHUB_TOKEN" | ||
"doc": "jsdoc lib" | ||
}, | ||
"devDependencies": { | ||
"chai": "^3.0.0", | ||
"github-changes": "^1.0.0", | ||
"jsdoc": "*", | ||
"jshint": "*", | ||
"mocha": "^2.2.4", | ||
"nock": "^2.0.1" | ||
"nock": "^2.6.0" | ||
}, | ||
"dependencies": { | ||
"chalk": "^1.0.0", | ||
"chalk": "^1.1.0", | ||
"co": "^4.5.4", | ||
"heroku-client": "^2.0.0" | ||
"heroku-client": "^2.0.0", | ||
"inflection": "^1.7.1" | ||
}, | ||
@@ -32,0 +31,0 @@ "bundledDependencies": [ |
@@ -141,2 +141,20 @@ # heroku-cli-util | ||
## Stylized output | ||
Pretty print a header and hash | ||
```js | ||
let cli = require('heroku-cli-util'); | ||
cli.styledHeader("MyApp"); | ||
cli.styledHash({name: "myapp", collaborators: ["user1@example.com", "user2@example.com"]}); | ||
``` | ||
Produces | ||
``` | ||
=== MyApp | ||
Collaborators: user1@example.com | ||
user1@example.com | ||
Name: myapp | ||
``` | ||
## Mocking | ||
@@ -143,0 +161,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5
234
629595
4
112
13545
+ Addedinflection@^1.7.1
+ Addedinflection@1.13.4(transitive)
Updatedchalk@^1.1.0