chalk 2.3.0 → 2.3.1
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/index.js +3 -3
- package/package.json +4 -4
- package/readme.md +6 -6
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
const escapeStringRegexp = require('escape-string-regexp');
|
|
3
3
|
const ansiStyles = require('ansi-styles');
|
|
4
|
-
const
|
|
4
|
+
const stdoutColor = require('supports-color').stdout;
|
|
5
5
|
|
|
6
6
|
const template = require('./templates.js');
|
|
7
7
|
|
|
@@ -19,7 +19,7 @@ function applyOptions(obj, options) {
|
|
|
19
19
|
options = options || {};
|
|
20
20
|
|
|
21
21
|
// Detect level if not set manually
|
|
22
|
-
const scLevel =
|
|
22
|
+
const scLevel = stdoutColor ? stdoutColor.level : 0;
|
|
23
23
|
obj.level = options.level === undefined ? scLevel : options.level;
|
|
24
24
|
obj.enabled = 'enabled' in options ? options.enabled : obj.level > 0;
|
|
25
25
|
}
|
|
@@ -224,5 +224,5 @@ function chalkTag(chalk, strings) {
|
|
|
224
224
|
Object.defineProperties(Chalk.prototype, styles);
|
|
225
225
|
|
|
226
226
|
module.exports = Chalk(); // eslint-disable-line new-cap
|
|
227
|
-
module.exports.supportsColor =
|
|
227
|
+
module.exports.supportsColor = stdoutColor;
|
|
228
228
|
module.exports.default = module.exports; // For TypeScript
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chalk",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"description": "Terminal string styling done right",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "chalk/chalk",
|
|
@@ -41,14 +41,14 @@
|
|
|
41
41
|
"text"
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"ansi-styles": "^3.
|
|
44
|
+
"ansi-styles": "^3.2.0",
|
|
45
45
|
"escape-string-regexp": "^1.0.5",
|
|
46
|
-
"supports-color": "^
|
|
46
|
+
"supports-color": "^5.2.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"ava": "*",
|
|
50
50
|
"coveralls": "^3.0.0",
|
|
51
|
-
"execa": "^0.
|
|
51
|
+
"execa": "^0.9.0",
|
|
52
52
|
"import-fresh": "^2.0.0",
|
|
53
53
|
"matcha": "^0.7.0",
|
|
54
54
|
"nyc": "^11.0.2",
|
package/readme.md
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
### [See what's new in Chalk 2](https://github.com/chalk/chalk/releases/tag/v2.0.0)
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
<img src="https://cdn.rawgit.com/chalk/ansi-styles/8261697c95bf34b6c7767e2cbe9941a851d59385/screenshot.svg" alt="" width="900">
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
## Highlights
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
- Doesn't extend `String.prototype`
|
|
27
27
|
- Clean and focused
|
|
28
28
|
- Actively maintained
|
|
29
|
-
- [Used by ~
|
|
29
|
+
- [Used by ~23,000 packages](https://www.npmjs.com/browse/depended/chalk) as of December 31, 2017
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
## Install
|
|
@@ -51,7 +51,7 @@ const chalk = require('chalk');
|
|
|
51
51
|
const log = console.log;
|
|
52
52
|
|
|
53
53
|
// Combine styled and normal strings
|
|
54
|
-
log(chalk.blue('Hello') + 'World' + chalk.red('!'));
|
|
54
|
+
log(chalk.blue('Hello') + ' World' + chalk.red('!'));
|
|
55
55
|
|
|
56
56
|
// Compose multiple styles using the chainable API
|
|
57
57
|
log(chalk.blue.bgRed.bold('Hello world!'));
|
|
@@ -124,7 +124,7 @@ Multiple arguments will be separated by space.
|
|
|
124
124
|
|
|
125
125
|
Color support is automatically detected, as is the level (see `chalk.level`). However, if you'd like to simply enable/disable Chalk, you can do so via the `.enabled` property.
|
|
126
126
|
|
|
127
|
-
Chalk is enabled by default unless
|
|
127
|
+
Chalk is enabled by default unless explicitly disabled via the constructor or `chalk.level` is `0`.
|
|
128
128
|
|
|
129
129
|
If you need to change this in a reusable module, create a new instance:
|
|
130
130
|
|
|
@@ -265,8 +265,8 @@ The following color models can be used:
|
|
|
265
265
|
- [`hex`](https://en.wikipedia.org/wiki/Web_colors#Hex_triplet) - Example: `chalk.hex('#FF8800').bold('Orange!')`
|
|
266
266
|
- [`keyword`](https://www.w3.org/wiki/CSS/Properties/color/keywords) (CSS keywords) - Example: `chalk.keyword('orange').bold('Orange!')`
|
|
267
267
|
- [`hsl`](https://en.wikipedia.org/wiki/HSL_and_HSV) - Example: `chalk.hsl(32, 100, 50).bold('Orange!')`
|
|
268
|
-
- [`hsv`](https://en.wikipedia.org/wiki/HSL_and_HSV) - Example: `chalk.
|
|
269
|
-
- [`hwb`](https://en.wikipedia.org/wiki/HWB_color_model) - Example: `chalk.
|
|
268
|
+
- [`hsv`](https://en.wikipedia.org/wiki/HSL_and_HSV) - Example: `chalk.hsv(32, 100, 100).bold('Orange!')`
|
|
269
|
+
- [`hwb`](https://en.wikipedia.org/wiki/HWB_color_model) - Example: `chalk.hwb(32, 0, 50).bold('Orange!')`
|
|
270
270
|
- `ansi16`
|
|
271
271
|
- `ansi256`
|
|
272
272
|
|