chalk 2.3.1 → 2.4.2

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.
Files changed (3) hide show
  1. package/index.js.flow +93 -0
  2. package/package.json +10 -5
  3. package/readme.md +7 -2
package/index.js.flow ADDED
@@ -0,0 +1,93 @@
1
+ // @flow strict
2
+
3
+ type TemplateStringsArray = $ReadOnlyArray<string>;
4
+
5
+ export type Level = $Values<{
6
+ None: 0,
7
+ Basic: 1,
8
+ Ansi256: 2,
9
+ TrueColor: 3
10
+ }>;
11
+
12
+ export type ChalkOptions = {|
13
+ enabled?: boolean,
14
+ level?: Level
15
+ |};
16
+
17
+ export type ColorSupport = {|
18
+ level: Level,
19
+ hasBasic: boolean,
20
+ has256: boolean,
21
+ has16m: boolean
22
+ |};
23
+
24
+ export interface Chalk {
25
+ (...text: string[]): string,
26
+ (text: TemplateStringsArray, ...placeholders: string[]): string,
27
+ constructor(options?: ChalkOptions): Chalk,
28
+ enabled: boolean,
29
+ level: Level,
30
+ rgb(r: number, g: number, b: number): Chalk,
31
+ hsl(h: number, s: number, l: number): Chalk,
32
+ hsv(h: number, s: number, v: number): Chalk,
33
+ hwb(h: number, w: number, b: number): Chalk,
34
+ bgHex(color: string): Chalk,
35
+ bgKeyword(color: string): Chalk,
36
+ bgRgb(r: number, g: number, b: number): Chalk,
37
+ bgHsl(h: number, s: number, l: number): Chalk,
38
+ bgHsv(h: number, s: number, v: number): Chalk,
39
+ bgHwb(h: number, w: number, b: number): Chalk,
40
+ hex(color: string): Chalk,
41
+ keyword(color: string): Chalk,
42
+
43
+ +reset: Chalk,
44
+ +bold: Chalk,
45
+ +dim: Chalk,
46
+ +italic: Chalk,
47
+ +underline: Chalk,
48
+ +inverse: Chalk,
49
+ +hidden: Chalk,
50
+ +strikethrough: Chalk,
51
+
52
+ +visible: Chalk,
53
+
54
+ +black: Chalk,
55
+ +red: Chalk,
56
+ +green: Chalk,
57
+ +yellow: Chalk,
58
+ +blue: Chalk,
59
+ +magenta: Chalk,
60
+ +cyan: Chalk,
61
+ +white: Chalk,
62
+ +gray: Chalk,
63
+ +grey: Chalk,
64
+ +blackBright: Chalk,
65
+ +redBright: Chalk,
66
+ +greenBright: Chalk,
67
+ +yellowBright: Chalk,
68
+ +blueBright: Chalk,
69
+ +magentaBright: Chalk,
70
+ +cyanBright: Chalk,
71
+ +whiteBright: Chalk,
72
+
73
+ +bgBlack: Chalk,
74
+ +bgRed: Chalk,
75
+ +bgGreen: Chalk,
76
+ +bgYellow: Chalk,
77
+ +bgBlue: Chalk,
78
+ +bgMagenta: Chalk,
79
+ +bgCyan: Chalk,
80
+ +bgWhite: Chalk,
81
+ +bgBlackBright: Chalk,
82
+ +bgRedBright: Chalk,
83
+ +bgGreenBright: Chalk,
84
+ +bgYellowBright: Chalk,
85
+ +bgBlueBright: Chalk,
86
+ +bgMagentaBright: Chalk,
87
+ +bgCyanBright: Chalk,
88
+ +bgWhiteBrigh: Chalk,
89
+
90
+ supportsColor: ColorSupport
91
+ };
92
+
93
+ declare module.exports: Chalk;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chalk",
3
- "version": "2.3.1",
3
+ "version": "2.4.2",
4
4
  "description": "Terminal string styling done right",
5
5
  "license": "MIT",
6
6
  "repository": "chalk/chalk",
@@ -8,14 +8,15 @@
8
8
  "node": ">=4"
9
9
  },
10
10
  "scripts": {
11
- "test": "xo && tsc --project types && nyc ava",
11
+ "test": "xo && tsc --project types && flow --max-warnings=0 && nyc ava",
12
12
  "bench": "matcha benchmark.js",
13
13
  "coveralls": "nyc report --reporter=text-lcov | coveralls"
14
14
  },
15
15
  "files": [
16
16
  "index.js",
17
17
  "templates.js",
18
- "types/index.d.ts"
18
+ "types/index.d.ts",
19
+ "index.js.flow"
19
20
  ],
20
21
  "keywords": [
21
22
  "color",
@@ -41,14 +42,15 @@
41
42
  "text"
42
43
  ],
43
44
  "dependencies": {
44
- "ansi-styles": "^3.2.0",
45
+ "ansi-styles": "^3.2.1",
45
46
  "escape-string-regexp": "^1.0.5",
46
- "supports-color": "^5.2.0"
47
+ "supports-color": "^5.3.0"
47
48
  },
48
49
  "devDependencies": {
49
50
  "ava": "*",
50
51
  "coveralls": "^3.0.0",
51
52
  "execa": "^0.9.0",
53
+ "flow-bin": "^0.68.0",
52
54
  "import-fresh": "^2.0.0",
53
55
  "matcha": "^0.7.0",
54
56
  "nyc": "^11.0.2",
@@ -61,6 +63,9 @@
61
63
  "envs": [
62
64
  "node",
63
65
  "mocha"
66
+ ],
67
+ "ignores": [
68
+ "test/_flow.js"
64
69
  ]
65
70
  }
66
71
  }
package/readme.md CHANGED
@@ -1,7 +1,7 @@
1
1
  <h1 align="center">
2
2
  <br>
3
3
  <br>
4
- <img width="320" src="https://cdn.rawgit.com/chalk/chalk/19935d6484811c5e468817f846b7b3d417d7bf4a/logo.svg" alt="chalk">
4
+ <img width="320" src="media/logo.svg" alt="Chalk">
5
5
  <br>
6
6
  <br>
7
7
  <br>
@@ -9,7 +9,7 @@
9
9
 
10
10
  > Terminal string styling done right
11
11
 
12
- [![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) [![Coverage Status](https://coveralls.io/repos/github/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/github/chalk/chalk?branch=master) [![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo) [![Mentioned in Awesome Node.js](https://awesome.re/mentioned-badge.svg)](https://github.com/sindresorhus/awesome-nodejs)
12
+ [![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) [![Coverage Status](https://coveralls.io/repos/github/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/github/chalk/chalk?branch=master) [![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo) [![Mentioned in Awesome Node.js](https://awesome.re/mentioned-badge.svg)](https://github.com/sindresorhus/awesome-nodejs)
13
13
 
14
14
  ### [See what's new in Chalk 2](https://github.com/chalk/chalk/releases/tag/v2.0.0)
15
15
 
@@ -35,6 +35,10 @@
35
35
  $ npm install chalk
36
36
  ```
37
37
 
38
+ <a href="https://www.patreon.com/sindresorhus">
39
+ <img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" width="160">
40
+ </a>
41
+
38
42
 
39
43
  ## Usage
40
44
 
@@ -296,6 +300,7 @@ If you're on Windows, do yourself a favor and use [`cmder`](http://cmder.net/) i
296
300
  - [chalk-animation](https://github.com/bokub/chalk-animation) - Animate strings in the terminal
297
301
  - [gradient-string](https://github.com/bokub/gradient-string) - Apply color gradients to strings
298
302
  - [chalk-pipe](https://github.com/LitoMore/chalk-pipe) - Create chalk style schemes with simpler style strings
303
+ - [terminal-link](https://github.com/sindresorhus/terminal-link) - Create clickable links in the terminal
299
304
 
300
305
 
301
306
  ## Maintainers