chalk 3.0.0-beta.2 → 3.0.0
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.d.ts +17 -0
- package/package.json +3 -3
- package/readme.md +8 -16
package/index.d.ts
CHANGED
|
@@ -213,6 +213,14 @@ declare namespace chalk {
|
|
|
213
213
|
*/
|
|
214
214
|
hwb(hue: number, whiteness: number, blackness: number): Chalk;
|
|
215
215
|
|
|
216
|
+
/**
|
|
217
|
+
Use a [Select/Set Graphic Rendition](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) (SGR) [color code number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) to set text color.
|
|
218
|
+
|
|
219
|
+
30 <= code && code < 38 || 90 <= code && code < 98
|
|
220
|
+
For example, 31 for red, 91 for redBright.
|
|
221
|
+
*/
|
|
222
|
+
ansi(code: number): Chalk;
|
|
223
|
+
|
|
216
224
|
/**
|
|
217
225
|
Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color.
|
|
218
226
|
*/
|
|
@@ -266,6 +274,15 @@ declare namespace chalk {
|
|
|
266
274
|
*/
|
|
267
275
|
bgHwb(hue: number, whiteness: number, blackness: number): Chalk;
|
|
268
276
|
|
|
277
|
+
/**
|
|
278
|
+
Use a [Select/Set Graphic Rendition](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) (SGR) [color code number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) to set background color.
|
|
279
|
+
|
|
280
|
+
30 <= code && code < 38 || 90 <= code && code < 98
|
|
281
|
+
For example, 31 for red, 91 for redBright.
|
|
282
|
+
Use the foreground code, not the background code (for example, not 41, nor 101).
|
|
283
|
+
*/
|
|
284
|
+
bgAnsi(code: number): Chalk;
|
|
285
|
+
|
|
269
286
|
/**
|
|
270
287
|
Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set background color.
|
|
271
288
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chalk",
|
|
3
|
-
"version": "3.0.0
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Terminal string styling done right",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "chalk/chalk",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"ava": "^2.4.0",
|
|
48
|
-
"coveralls": "^3.0.
|
|
49
|
-
"execa": "^2.0
|
|
48
|
+
"coveralls": "^3.0.7",
|
|
49
|
+
"execa": "^3.2.0",
|
|
50
50
|
"import-fresh": "^3.1.0",
|
|
51
51
|
"matcha": "^0.7.0",
|
|
52
52
|
"nyc": "^14.1.1",
|
package/readme.md
CHANGED
|
@@ -13,8 +13,6 @@
|
|
|
13
13
|
|
|
14
14
|
<img src="https://cdn.jsdelivr.net/gh/chalk/ansi-styles@8261697c95bf34b6c7767e2cbe9941a851d59385/screenshot.svg" width="900">
|
|
15
15
|
|
|
16
|
-
**This readme reflects the next major version that is currently in development. You probably want [the v2 readme](https://www.npmjs.com/package/chalk).**
|
|
17
|
-
|
|
18
16
|
|
|
19
17
|
## Highlights
|
|
20
18
|
|
|
@@ -261,7 +259,7 @@ The following color models can be used:
|
|
|
261
259
|
- [`hsl`](https://en.wikipedia.org/wiki/HSL_and_HSV) - Example: `chalk.hsl(32, 100, 50).bold('Orange!')`
|
|
262
260
|
- [`hsv`](https://en.wikipedia.org/wiki/HSL_and_HSV) - Example: `chalk.hsv(32, 100, 100).bold('Orange!')`
|
|
263
261
|
- [`hwb`](https://en.wikipedia.org/wiki/HWB_color_model) - Example: `chalk.hwb(32, 0, 50).bold('Orange!')`
|
|
264
|
-
- `
|
|
262
|
+
- [`ansi`](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) - Example: `chalk.ansi(31).bgAnsi(93)('red on yellowBright')`
|
|
265
263
|
- [`ansi256`](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) - Example: `chalk.bgAnsi256(194)('Honeydew, more or less')`
|
|
266
264
|
|
|
267
265
|
|
|
@@ -275,6 +273,13 @@ If you're on Windows, do yourself a favor and use [Windows Terminal](https://git
|
|
|
275
273
|
[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) and the package is unmaintained. Although there are other packages, they either do too much or not enough. Chalk is a clean and focused alternative.
|
|
276
274
|
|
|
277
275
|
|
|
276
|
+
## chalk for enterprise
|
|
277
|
+
|
|
278
|
+
Available as part of the Tidelift Subscription.
|
|
279
|
+
|
|
280
|
+
The maintainers of chalk and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-chalk?utm_source=npm-chalk&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|
|
281
|
+
|
|
282
|
+
|
|
278
283
|
## Related
|
|
279
284
|
|
|
280
285
|
- [chalk-cli](https://github.com/chalk/chalk-cli) - CLI for this module
|
|
@@ -297,16 +302,3 @@ If you're on Windows, do yourself a favor and use [Windows Terminal](https://git
|
|
|
297
302
|
|
|
298
303
|
- [Sindre Sorhus](https://github.com/sindresorhus)
|
|
299
304
|
- [Josh Junon](https://github.com/qix-)
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
---
|
|
303
|
-
|
|
304
|
-
<div align="center">
|
|
305
|
-
<b>
|
|
306
|
-
<a href="https://tidelift.com/subscription/pkg/npm-chalk?utm_source=npm-chalk&utm_medium=referral&utm_campaign=readme">Get professional support for Chalk with a Tidelift subscription</a>
|
|
307
|
-
</b>
|
|
308
|
-
<br>
|
|
309
|
-
<sub>
|
|
310
|
-
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
|
311
|
-
</sub>
|
|
312
|
-
</div>
|