@socketsecurity/cli-with-sentry 0.14.137 → 0.14.138
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blessed/LICENSE +20 -0
- package/dist/blessed/lib/alias.js +519 -0
- package/dist/blessed/lib/blessed.js +32 -0
- package/dist/blessed/lib/colors.js +490 -0
- package/dist/blessed/lib/events.js +195 -0
- package/dist/blessed/lib/gpmclient.js +245 -0
- package/dist/blessed/lib/helpers.js +170 -0
- package/dist/blessed/lib/keys.js +512 -0
- package/dist/blessed/lib/program.js +4530 -0
- package/dist/blessed/lib/tput.js +3111 -0
- package/dist/blessed/lib/unicode.js +912 -0
- package/dist/blessed/lib/widget.js +60 -0
- package/dist/blessed/lib/widgets/ansiimage.js +173 -0
- package/dist/blessed/lib/widgets/bigtext.js +170 -0
- package/dist/blessed/lib/widgets/box.js +34 -0
- package/dist/blessed/lib/widgets/button.js +62 -0
- package/dist/blessed/lib/widgets/checkbox.js +95 -0
- package/dist/blessed/lib/widgets/element.js +2871 -0
- package/dist/blessed/lib/widgets/filemanager.js +223 -0
- package/dist/blessed/lib/widgets/form.js +301 -0
- package/dist/blessed/lib/widgets/image.js +71 -0
- package/dist/blessed/lib/widgets/input.js +34 -0
- package/dist/blessed/lib/widgets/layout.js +249 -0
- package/dist/blessed/lib/widgets/line.js +59 -0
- package/dist/blessed/lib/widgets/list.js +652 -0
- package/dist/blessed/lib/widgets/listbar.js +452 -0
- package/dist/blessed/lib/widgets/listtable.js +265 -0
- package/dist/blessed/lib/widgets/loading.js +88 -0
- package/dist/blessed/lib/widgets/log.js +82 -0
- package/dist/blessed/lib/widgets/message.js +145 -0
- package/dist/blessed/lib/widgets/node.js +314 -0
- package/dist/blessed/lib/widgets/overlayimage.js +794 -0
- package/dist/blessed/lib/widgets/progressbar.js +166 -0
- package/dist/blessed/lib/widgets/prompt.js +127 -0
- package/dist/blessed/lib/widgets/question.js +129 -0
- package/dist/blessed/lib/widgets/radiobutton.js +62 -0
- package/dist/blessed/lib/widgets/radioset.js +36 -0
- package/dist/blessed/lib/widgets/screen.js +2485 -0
- package/dist/blessed/lib/widgets/scrollablebox.js +415 -0
- package/dist/blessed/lib/widgets/scrollabletext.js +35 -0
- package/dist/blessed/lib/widgets/table.js +383 -0
- package/dist/blessed/lib/widgets/terminal.js +452 -0
- package/dist/blessed/lib/widgets/text.js +35 -0
- package/dist/blessed/lib/widgets/textarea.js +376 -0
- package/dist/blessed/lib/widgets/textbox.js +79 -0
- package/dist/blessed/lib/widgets/video.js +130 -0
- package/dist/blessed/usr/fonts/AUTHORS +1 -0
- package/dist/blessed/usr/fonts/LICENSE +94 -0
- package/dist/blessed/usr/fonts/README +340 -0
- package/dist/blessed/usr/fonts/ter-u14b.json +17826 -0
- package/dist/blessed/usr/fonts/ter-u14n.json +17826 -0
- package/dist/blessed/usr/linux +0 -0
- package/dist/blessed/usr/windows-ansi +0 -0
- package/dist/blessed/usr/xterm +0 -0
- package/dist/blessed/usr/xterm-256color +0 -0
- package/dist/blessed/usr/xterm.termcap +243 -0
- package/dist/blessed/usr/xterm.terminfo +1977 -0
- package/dist/blessed/vendor/tng.js +1876 -0
- package/dist/blessed-contrib/LICENSE.md +21 -0
- package/dist/blessed-contrib/lib/layout/carousel.js +82 -0
- package/dist/blessed-contrib/lib/layout/grid.js +46 -0
- package/dist/blessed-contrib/lib/server-utils.js +83 -0
- package/dist/blessed-contrib/lib/utils.js +73 -0
- package/dist/blessed-contrib/lib/widget/canvas.js +52 -0
- package/dist/blessed-contrib/lib/widget/charts/bar.js +99 -0
- package/dist/blessed-contrib/lib/widget/charts/line.js +311 -0
- package/dist/blessed-contrib/lib/widget/charts/stacked-bar.js +245 -0
- package/dist/blessed-contrib/lib/widget/donut.js +183 -0
- package/dist/blessed-contrib/lib/widget/gauge-list.js +111 -0
- package/dist/blessed-contrib/lib/widget/gauge.js +127 -0
- package/dist/blessed-contrib/lib/widget/lcd.js +497 -0
- package/dist/blessed-contrib/lib/widget/log.js +32 -0
- package/dist/blessed-contrib/lib/widget/map.js +97 -0
- package/dist/blessed-contrib/lib/widget/markdown.js +68 -0
- package/dist/blessed-contrib/lib/widget/picture.js +61 -0
- package/dist/blessed-contrib/lib/widget/sparkline.js +66 -0
- package/dist/blessed-contrib/lib/widget/table.js +141 -0
- package/dist/blessed-contrib/lib/widget/tree.js +179 -0
- package/dist/blessed-contrib/node_modules/ansi-regex/index.js +6 -0
- package/dist/blessed-contrib/node_modules/ansi-regex/license +21 -0
- package/dist/blessed-contrib/node_modules/ansi-regex/package.json +64 -0
- package/dist/blessed-contrib/node_modules/ansi-regex/readme.md +39 -0
- package/dist/blessed-contrib/node_modules/ansi-styles/index.js +67 -0
- package/dist/blessed-contrib/node_modules/ansi-styles/license +21 -0
- package/dist/blessed-contrib/node_modules/ansi-styles/package.json +50 -0
- package/dist/blessed-contrib/node_modules/ansi-styles/readme.md +86 -0
- package/dist/blessed-contrib/node_modules/chalk/index.js +118 -0
- package/dist/blessed-contrib/node_modules/chalk/license +21 -0
- package/dist/blessed-contrib/node_modules/chalk/package.json +70 -0
- package/dist/blessed-contrib/node_modules/chalk/readme.md +213 -0
- package/dist/blessed-contrib/node_modules/escape-string-regexp/index.js +13 -0
- package/dist/blessed-contrib/node_modules/escape-string-regexp/license +21 -0
- package/dist/blessed-contrib/node_modules/escape-string-regexp/package.json +41 -0
- package/dist/blessed-contrib/node_modules/escape-string-regexp/readme.md +27 -0
- package/dist/blessed-contrib/node_modules/strip-ansi/index.js +8 -0
- package/dist/blessed-contrib/node_modules/strip-ansi/license +21 -0
- package/dist/blessed-contrib/node_modules/strip-ansi/package.json +57 -0
- package/dist/blessed-contrib/node_modules/strip-ansi/readme.md +33 -0
- package/dist/blessed-contrib/node_modules/supports-color/index.js +52 -0
- package/dist/blessed-contrib/node_modules/supports-color/license +21 -0
- package/dist/blessed-contrib/node_modules/supports-color/package.json +49 -0
- package/dist/blessed-contrib/node_modules/supports-color/readme.md +36 -0
- package/dist/cli.js +9 -8
- package/dist/cli.js.map +1 -1
- package/dist/instrument-with-sentry.js +2 -2
- package/dist/instrument-with-sentry.js.map +1 -1
- package/dist/shadow-npm-inject.js +2 -2
- package/dist/shadow-npm-inject.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ansi-styles",
|
|
3
|
+
"version": "2.2.1",
|
|
4
|
+
"description": "ANSI escape codes for styling strings in the terminal",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": "chalk/ansi-styles",
|
|
7
|
+
"author": {
|
|
8
|
+
"name": "Sindre Sorhus",
|
|
9
|
+
"email": "sindresorhus@gmail.com",
|
|
10
|
+
"url": "sindresorhus.com"
|
|
11
|
+
},
|
|
12
|
+
"maintainers": [
|
|
13
|
+
"Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)",
|
|
14
|
+
"Joshua Appelman <jappelman@xebia.com> (jbnicolai.com)"
|
|
15
|
+
],
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=0.10.0"
|
|
18
|
+
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"test": "mocha"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"index.js"
|
|
24
|
+
],
|
|
25
|
+
"keywords": [
|
|
26
|
+
"ansi",
|
|
27
|
+
"styles",
|
|
28
|
+
"color",
|
|
29
|
+
"colour",
|
|
30
|
+
"colors",
|
|
31
|
+
"terminal",
|
|
32
|
+
"console",
|
|
33
|
+
"cli",
|
|
34
|
+
"string",
|
|
35
|
+
"tty",
|
|
36
|
+
"escape",
|
|
37
|
+
"formatting",
|
|
38
|
+
"rgb",
|
|
39
|
+
"256",
|
|
40
|
+
"shell",
|
|
41
|
+
"xterm",
|
|
42
|
+
"log",
|
|
43
|
+
"logging",
|
|
44
|
+
"command-line",
|
|
45
|
+
"text"
|
|
46
|
+
],
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"mocha": "*"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# ansi-styles [](https://travis-ci.org/chalk/ansi-styles)
|
|
2
|
+
|
|
3
|
+
> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal
|
|
4
|
+
|
|
5
|
+
You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings.
|
|
6
|
+
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
$ npm install --save ansi-styles
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```js
|
|
20
|
+
var ansi = require('ansi-styles');
|
|
21
|
+
|
|
22
|
+
console.log(ansi.green.open + 'Hello world!' + ansi.green.close);
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## API
|
|
27
|
+
|
|
28
|
+
Each style has an `open` and `close` property.
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
## Styles
|
|
32
|
+
|
|
33
|
+
### Modifiers
|
|
34
|
+
|
|
35
|
+
- `reset`
|
|
36
|
+
- `bold`
|
|
37
|
+
- `dim`
|
|
38
|
+
- `italic` *(not widely supported)*
|
|
39
|
+
- `underline`
|
|
40
|
+
- `inverse`
|
|
41
|
+
- `hidden`
|
|
42
|
+
- `strikethrough` *(not widely supported)*
|
|
43
|
+
|
|
44
|
+
### Colors
|
|
45
|
+
|
|
46
|
+
- `black`
|
|
47
|
+
- `red`
|
|
48
|
+
- `green`
|
|
49
|
+
- `yellow`
|
|
50
|
+
- `blue`
|
|
51
|
+
- `magenta`
|
|
52
|
+
- `cyan`
|
|
53
|
+
- `white`
|
|
54
|
+
- `gray`
|
|
55
|
+
|
|
56
|
+
### Background colors
|
|
57
|
+
|
|
58
|
+
- `bgBlack`
|
|
59
|
+
- `bgRed`
|
|
60
|
+
- `bgGreen`
|
|
61
|
+
- `bgYellow`
|
|
62
|
+
- `bgBlue`
|
|
63
|
+
- `bgMagenta`
|
|
64
|
+
- `bgCyan`
|
|
65
|
+
- `bgWhite`
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
## Advanced usage
|
|
69
|
+
|
|
70
|
+
By default you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module.
|
|
71
|
+
|
|
72
|
+
- `ansi.modifiers`
|
|
73
|
+
- `ansi.colors`
|
|
74
|
+
- `ansi.bgColors`
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
###### Example
|
|
78
|
+
|
|
79
|
+
```js
|
|
80
|
+
console.log(ansi.colors.green.open);
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
## License
|
|
85
|
+
|
|
86
|
+
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
|
|
2
|
+
'use strict'
|
|
3
|
+
;
|
|
4
|
+
var escapeStringRegexp = require('escape-string-regexp');
|
|
5
|
+
var ansiStyles = require('ansi-styles');
|
|
6
|
+
var stripAnsi = require('strip-ansi');
|
|
7
|
+
var hasAnsi = require('has-ansi');
|
|
8
|
+
var supportsColor = require('supports-color');
|
|
9
|
+
var defineProps = Object.defineProperties;
|
|
10
|
+
var isSimpleWindowsTerm = process.platform === 'win32' && !/^xterm/i.test(process.env.TERM);
|
|
11
|
+
|
|
12
|
+
function Chalk(options) {
|
|
13
|
+
// detect mode if not set manually
|
|
14
|
+
this.enabled = !options || options.enabled === undefined ? supportsColor : options.enabled;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// use bright blue on Windows as the normal blue color is illegible
|
|
18
|
+
if (isSimpleWindowsTerm) {
|
|
19
|
+
ansiStyles.blue.open = '\u001b[94m';
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
var styles = (function () {
|
|
23
|
+
var ret = {};
|
|
24
|
+
|
|
25
|
+
Object.keys(ansiStyles).forEach(function (key) {
|
|
26
|
+
ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');
|
|
27
|
+
|
|
28
|
+
ret[key] = {
|
|
29
|
+
get: function () {
|
|
30
|
+
return build.call(this, this._styles.concat(key));
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
return ret;
|
|
36
|
+
})();
|
|
37
|
+
|
|
38
|
+
var proto = defineProps(function chalk() {}, styles);
|
|
39
|
+
|
|
40
|
+
function build(_styles) {
|
|
41
|
+
var builder = function () {
|
|
42
|
+
return applyStyle.apply(builder, arguments);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
builder._styles = _styles;
|
|
46
|
+
builder.enabled = this.enabled;
|
|
47
|
+
// __proto__ is used because we must return a function, but there is
|
|
48
|
+
// no way to create a function with a different prototype.
|
|
49
|
+
/* eslint-disable no-proto */
|
|
50
|
+
builder.__proto__ = proto;
|
|
51
|
+
|
|
52
|
+
return builder;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function applyStyle() {
|
|
56
|
+
// support varags, but simply cast to string in case there's only one arg
|
|
57
|
+
var args = arguments;
|
|
58
|
+
var argsLen = args.length;
|
|
59
|
+
var str = argsLen !== 0 && String(arguments[0]);
|
|
60
|
+
|
|
61
|
+
if (argsLen > 1) {
|
|
62
|
+
// don't slice `arguments`, it prevents v8 optimizations
|
|
63
|
+
for (var a = 1; a < argsLen; a++) {
|
|
64
|
+
str += ' ' + args[a];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (!this.enabled || !str) {
|
|
69
|
+
return str;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
var nestedStyles = this._styles;
|
|
73
|
+
var i = nestedStyles.length;
|
|
74
|
+
|
|
75
|
+
// Turns out that on Windows dimmed gray text becomes invisible in cmd.exe,
|
|
76
|
+
// see https://github.com/chalk/chalk/issues/58
|
|
77
|
+
// If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop.
|
|
78
|
+
var originalDim = ansiStyles.dim.open;
|
|
79
|
+
if (isSimpleWindowsTerm && (nestedStyles.indexOf('gray') !== -1 || nestedStyles.indexOf('grey') !== -1)) {
|
|
80
|
+
ansiStyles.dim.open = '';
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
while (i--) {
|
|
84
|
+
var code = ansiStyles[nestedStyles[i]];
|
|
85
|
+
|
|
86
|
+
// Replace any instances already present with a re-opening code
|
|
87
|
+
// otherwise only the part of the string until said closing code
|
|
88
|
+
// will be colored, and the rest will simply be 'plain'.
|
|
89
|
+
str = code.open + str.replace(code.closeRe, code.open) + code.close;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Reset the original 'dim' if we changed it to work around the Windows dimmed gray issue.
|
|
93
|
+
ansiStyles.dim.open = originalDim;
|
|
94
|
+
|
|
95
|
+
return str;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function init() {
|
|
99
|
+
var ret = {};
|
|
100
|
+
|
|
101
|
+
Object.keys(styles).forEach(function (name) {
|
|
102
|
+
ret[name] = {
|
|
103
|
+
get: function () {
|
|
104
|
+
return build.call(this, [name]);
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
return ret;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
defineProps(Chalk.prototype, init());
|
|
113
|
+
|
|
114
|
+
module.exports = new Chalk();
|
|
115
|
+
module.exports.styles = ansiStyles;
|
|
116
|
+
module.exports.hasColor = hasAnsi;
|
|
117
|
+
module.exports.stripColor = stripAnsi;
|
|
118
|
+
module.exports.supportsColor = supportsColor;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "chalk",
|
|
3
|
+
"version": "1.1.3",
|
|
4
|
+
"description": "Terminal string styling done right. Much color.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": "chalk/chalk",
|
|
7
|
+
"maintainers": [
|
|
8
|
+
"Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)",
|
|
9
|
+
"Joshua Appelman <jappelman@xebia.com> (jbnicolai.com)",
|
|
10
|
+
"JD Ballard <i.am.qix@gmail.com> (github.com/qix-)"
|
|
11
|
+
],
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": ">=0.10.0"
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"test": "xo && mocha",
|
|
17
|
+
"bench": "matcha benchmark.js",
|
|
18
|
+
"coverage": "nyc npm test && nyc report",
|
|
19
|
+
"coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"index.js"
|
|
23
|
+
],
|
|
24
|
+
"keywords": [
|
|
25
|
+
"color",
|
|
26
|
+
"colour",
|
|
27
|
+
"colors",
|
|
28
|
+
"terminal",
|
|
29
|
+
"console",
|
|
30
|
+
"cli",
|
|
31
|
+
"string",
|
|
32
|
+
"str",
|
|
33
|
+
"ansi",
|
|
34
|
+
"style",
|
|
35
|
+
"styles",
|
|
36
|
+
"tty",
|
|
37
|
+
"formatting",
|
|
38
|
+
"rgb",
|
|
39
|
+
"256",
|
|
40
|
+
"shell",
|
|
41
|
+
"xterm",
|
|
42
|
+
"log",
|
|
43
|
+
"logging",
|
|
44
|
+
"command-line",
|
|
45
|
+
"text"
|
|
46
|
+
],
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"ansi-styles": "^2.2.1",
|
|
49
|
+
"escape-string-regexp": "^1.0.2",
|
|
50
|
+
"has-ansi": "^2.0.0",
|
|
51
|
+
"strip-ansi": "^3.0.0",
|
|
52
|
+
"supports-color": "^2.0.0"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"coveralls": "^2.11.2",
|
|
56
|
+
"matcha": "^0.6.0",
|
|
57
|
+
"mocha": "*",
|
|
58
|
+
"nyc": "^3.0.0",
|
|
59
|
+
"require-uncached": "^1.0.2",
|
|
60
|
+
"resolve-from": "^1.0.0",
|
|
61
|
+
"semver": "^4.3.3",
|
|
62
|
+
"xo": "*"
|
|
63
|
+
},
|
|
64
|
+
"xo": {
|
|
65
|
+
"envs": [
|
|
66
|
+
"node",
|
|
67
|
+
"mocha"
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
<h1 align="center">
|
|
2
|
+
<br>
|
|
3
|
+
<br>
|
|
4
|
+
<img width="360" src="https://cdn.rawgit.com/chalk/chalk/19935d6484811c5e468817f846b7b3d417d7bf4a/logo.svg" alt="chalk">
|
|
5
|
+
<br>
|
|
6
|
+
<br>
|
|
7
|
+
<br>
|
|
8
|
+
</h1>
|
|
9
|
+
|
|
10
|
+
> Terminal string styling done right
|
|
11
|
+
|
|
12
|
+
[](https://travis-ci.org/chalk/chalk)
|
|
13
|
+
[](https://coveralls.io/r/chalk/chalk?branch=master)
|
|
14
|
+
[](https://www.youtube.com/watch?v=9auOCbH5Ns4)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
[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.
|
|
18
|
+
|
|
19
|
+
**Chalk is a clean and focused alternative.**
|
|
20
|
+
|
|
21
|
+

|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
## Why
|
|
25
|
+
|
|
26
|
+
- Highly performant
|
|
27
|
+
- Doesn't extend `String.prototype`
|
|
28
|
+
- Expressive API
|
|
29
|
+
- Ability to nest styles
|
|
30
|
+
- Clean and focused
|
|
31
|
+
- Auto-detects color support
|
|
32
|
+
- Actively maintained
|
|
33
|
+
- [Used by ~4500 modules](https://www.npmjs.com/browse/depended/chalk) as of July 15, 2015
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
## Install
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
$ npm install --save chalk
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
## Usage
|
|
44
|
+
|
|
45
|
+
Chalk comes with an easy to use composable API where you just chain and nest the styles you want.
|
|
46
|
+
|
|
47
|
+
```js
|
|
48
|
+
var chalk = require('chalk');
|
|
49
|
+
|
|
50
|
+
// style a string
|
|
51
|
+
chalk.blue('Hello world!');
|
|
52
|
+
|
|
53
|
+
// combine styled and normal strings
|
|
54
|
+
chalk.blue('Hello') + 'World' + chalk.red('!');
|
|
55
|
+
|
|
56
|
+
// compose multiple styles using the chainable API
|
|
57
|
+
chalk.blue.bgRed.bold('Hello world!');
|
|
58
|
+
|
|
59
|
+
// pass in multiple arguments
|
|
60
|
+
chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz');
|
|
61
|
+
|
|
62
|
+
// nest styles
|
|
63
|
+
chalk.red('Hello', chalk.underline.bgBlue('world') + '!');
|
|
64
|
+
|
|
65
|
+
// nest styles of the same type even (color, underline, background)
|
|
66
|
+
chalk.green(
|
|
67
|
+
'I am a green line ' +
|
|
68
|
+
chalk.blue.underline.bold('with a blue substring') +
|
|
69
|
+
' that becomes green again!'
|
|
70
|
+
);
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Easily define your own themes.
|
|
74
|
+
|
|
75
|
+
```js
|
|
76
|
+
var chalk = require('chalk');
|
|
77
|
+
var error = chalk.bold.red;
|
|
78
|
+
console.log(error('Error!'));
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Take advantage of console.log [string substitution](http://nodejs.org/docs/latest/api/console.html#console_console_log_data).
|
|
82
|
+
|
|
83
|
+
```js
|
|
84
|
+
var name = 'Sindre';
|
|
85
|
+
console.log(chalk.green('Hello %s'), name);
|
|
86
|
+
//=> Hello Sindre
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
## API
|
|
91
|
+
|
|
92
|
+
### chalk.`<style>[.<style>...](string, [string...])`
|
|
93
|
+
|
|
94
|
+
Example: `chalk.red.bold.underline('Hello', 'world');`
|
|
95
|
+
|
|
96
|
+
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`.
|
|
97
|
+
|
|
98
|
+
Multiple arguments will be separated by space.
|
|
99
|
+
|
|
100
|
+
### chalk.enabled
|
|
101
|
+
|
|
102
|
+
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.
|
|
103
|
+
|
|
104
|
+
If you need to change this in a reusable module create a new instance:
|
|
105
|
+
|
|
106
|
+
```js
|
|
107
|
+
var ctx = new chalk.constructor({enabled: false});
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### chalk.supportsColor
|
|
111
|
+
|
|
112
|
+
Detect whether the terminal [supports color](https://github.com/chalk/supports-color). Used internally and handled for you, but exposed for convenience.
|
|
113
|
+
|
|
114
|
+
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`.
|
|
115
|
+
|
|
116
|
+
### chalk.styles
|
|
117
|
+
|
|
118
|
+
Exposes the styles as [ANSI escape codes](https://github.com/chalk/ansi-styles).
|
|
119
|
+
|
|
120
|
+
Generally not useful, but you might need just the `.open` or `.close` escape code if you're mixing externally styled strings with your own.
|
|
121
|
+
|
|
122
|
+
```js
|
|
123
|
+
var chalk = require('chalk');
|
|
124
|
+
|
|
125
|
+
console.log(chalk.styles.red);
|
|
126
|
+
//=> {open: '\u001b[31m', close: '\u001b[39m'}
|
|
127
|
+
|
|
128
|
+
console.log(chalk.styles.red.open + 'Hello' + chalk.styles.red.close);
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### chalk.hasColor(string)
|
|
132
|
+
|
|
133
|
+
Check whether a string [has color](https://github.com/chalk/has-ansi).
|
|
134
|
+
|
|
135
|
+
### chalk.stripColor(string)
|
|
136
|
+
|
|
137
|
+
[Strip color](https://github.com/chalk/strip-ansi) from a string.
|
|
138
|
+
|
|
139
|
+
Can be useful in combination with `.supportsColor` to strip color on externally styled text when it's not supported.
|
|
140
|
+
|
|
141
|
+
Example:
|
|
142
|
+
|
|
143
|
+
```js
|
|
144
|
+
var chalk = require('chalk');
|
|
145
|
+
var styledString = getText();
|
|
146
|
+
|
|
147
|
+
if (!chalk.supportsColor) {
|
|
148
|
+
styledString = chalk.stripColor(styledString);
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
## Styles
|
|
154
|
+
|
|
155
|
+
### Modifiers
|
|
156
|
+
|
|
157
|
+
- `reset`
|
|
158
|
+
- `bold`
|
|
159
|
+
- `dim`
|
|
160
|
+
- `italic` *(not widely supported)*
|
|
161
|
+
- `underline`
|
|
162
|
+
- `inverse`
|
|
163
|
+
- `hidden`
|
|
164
|
+
- `strikethrough` *(not widely supported)*
|
|
165
|
+
|
|
166
|
+
### Colors
|
|
167
|
+
|
|
168
|
+
- `black`
|
|
169
|
+
- `red`
|
|
170
|
+
- `green`
|
|
171
|
+
- `yellow`
|
|
172
|
+
- `blue` *(on Windows the bright version is used as normal blue is illegible)*
|
|
173
|
+
- `magenta`
|
|
174
|
+
- `cyan`
|
|
175
|
+
- `white`
|
|
176
|
+
- `gray`
|
|
177
|
+
|
|
178
|
+
### Background colors
|
|
179
|
+
|
|
180
|
+
- `bgBlack`
|
|
181
|
+
- `bgRed`
|
|
182
|
+
- `bgGreen`
|
|
183
|
+
- `bgYellow`
|
|
184
|
+
- `bgBlue`
|
|
185
|
+
- `bgMagenta`
|
|
186
|
+
- `bgCyan`
|
|
187
|
+
- `bgWhite`
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
## 256-colors
|
|
191
|
+
|
|
192
|
+
Chalk does not support anything other than the base eight colors, which guarantees it will work on all terminals and systems. Some terminals, specifically `xterm` compliant ones, will support the full range of 8-bit colors. For this the lower level [ansi-256-colors](https://github.com/jbnicolai/ansi-256-colors) package can be used.
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
## Windows
|
|
196
|
+
|
|
197
|
+
If you're on Windows, do yourself a favor and use [`cmder`](http://bliker.github.io/cmder/) instead of `cmd.exe`.
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
## Related
|
|
201
|
+
|
|
202
|
+
- [chalk-cli](https://github.com/chalk/chalk-cli) - CLI for this module
|
|
203
|
+
- [ansi-styles](https://github.com/chalk/ansi-styles/) - ANSI escape codes for styling strings in the terminal
|
|
204
|
+
- [supports-color](https://github.com/chalk/supports-color/) - Detect whether a terminal supports color
|
|
205
|
+
- [strip-ansi](https://github.com/chalk/strip-ansi) - Strip ANSI escape codes
|
|
206
|
+
- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes
|
|
207
|
+
- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes
|
|
208
|
+
- [wrap-ansi](https://github.com/chalk/wrap-ansi) - Wordwrap a string with ANSI escape codes
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
## License
|
|
212
|
+
|
|
213
|
+
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "escape-string-regexp",
|
|
3
|
+
"version": "1.0.5",
|
|
4
|
+
"description": "Escape RegExp special characters",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": "sindresorhus/escape-string-regexp",
|
|
7
|
+
"author": {
|
|
8
|
+
"name": "Sindre Sorhus",
|
|
9
|
+
"email": "sindresorhus@gmail.com",
|
|
10
|
+
"url": "sindresorhus.com"
|
|
11
|
+
},
|
|
12
|
+
"maintainers": [
|
|
13
|
+
"Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)",
|
|
14
|
+
"Joshua Boy Nicolai Appelman <joshua@jbna.nl> (jbna.nl)"
|
|
15
|
+
],
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=0.8.0"
|
|
18
|
+
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"test": "xo && ava"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"index.js"
|
|
24
|
+
],
|
|
25
|
+
"keywords": [
|
|
26
|
+
"escape",
|
|
27
|
+
"regex",
|
|
28
|
+
"regexp",
|
|
29
|
+
"re",
|
|
30
|
+
"regular",
|
|
31
|
+
"expression",
|
|
32
|
+
"string",
|
|
33
|
+
"str",
|
|
34
|
+
"special",
|
|
35
|
+
"characters"
|
|
36
|
+
],
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"ava": "*",
|
|
39
|
+
"xo": "*"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# escape-string-regexp [](https://travis-ci.org/sindresorhus/escape-string-regexp)
|
|
2
|
+
|
|
3
|
+
> Escape RegExp special characters
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
$ npm install --save escape-string-regexp
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
const escapeStringRegexp = require('escape-string-regexp');
|
|
17
|
+
|
|
18
|
+
const escapedString = escapeStringRegexp('how much $ for a unicorn?');
|
|
19
|
+
//=> 'how much \$ for a unicorn\?'
|
|
20
|
+
|
|
21
|
+
new RegExp(escapedString);
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## License
|
|
26
|
+
|
|
27
|
+
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|