cdk-booster 1.0.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/LICENSE +353 -0
- package/LICENSE.md +350 -0
- package/README.md +114 -0
- package/dist/cdk-booster.d.ts +29 -0
- package/dist/cdk-booster.mjs +733 -0
- package/dist/cdkFrameworkWorker.mjs +50 -0
- package/dist/configuration.d.ts +16 -0
- package/dist/configuration.mjs +29 -0
- package/dist/constants.d.ts +1 -0
- package/dist/constants.mjs +3 -0
- package/dist/getConfigFromCliArgs.d.ts +7 -0
- package/dist/getConfigFromCliArgs.mjs +23 -0
- package/dist/getDirname.d.ts +10 -0
- package/dist/getDirname.mjs +19 -0
- package/dist/logger.d.ts +51 -0
- package/dist/logger.mjs +83 -0
- package/dist/types/bundleSettings.d.ts +6 -0
- package/dist/types/bundleSettings.mjs +1 -0
- package/dist/types/cbConfig.d.ts +8 -0
- package/dist/types/cbConfig.mjs +1 -0
- package/dist/types/lambdaBundle.d.ts +11 -0
- package/dist/types/lambdaBundle.mjs +1 -0
- package/dist/utils/findPackageJson.d.ts +6 -0
- package/dist/utils/findPackageJson.mjs +33 -0
- package/dist/version.d.ts +5 -0
- package/dist/version.mjs +25 -0
- package/node_modules/chalk/license +9 -0
- package/node_modules/chalk/package.json +83 -0
- package/node_modules/chalk/readme.md +297 -0
- package/node_modules/chalk/source/index.d.ts +325 -0
- package/node_modules/chalk/source/index.js +225 -0
- package/node_modules/chalk/source/utilities.js +33 -0
- package/node_modules/chalk/source/vendor/ansi-styles/index.d.ts +236 -0
- package/node_modules/chalk/source/vendor/ansi-styles/index.js +223 -0
- package/node_modules/chalk/source/vendor/supports-color/browser.d.ts +1 -0
- package/node_modules/chalk/source/vendor/supports-color/browser.js +34 -0
- package/node_modules/chalk/source/vendor/supports-color/index.d.ts +55 -0
- package/node_modules/chalk/source/vendor/supports-color/index.js +190 -0
- package/node_modules/commander/LICENSE +22 -0
- package/node_modules/commander/Readme.md +1159 -0
- package/node_modules/commander/esm.mjs +16 -0
- package/node_modules/commander/index.js +24 -0
- package/node_modules/commander/lib/argument.js +149 -0
- package/node_modules/commander/lib/command.js +2778 -0
- package/node_modules/commander/lib/error.js +39 -0
- package/node_modules/commander/lib/help.js +747 -0
- package/node_modules/commander/lib/option.js +379 -0
- package/node_modules/commander/lib/suggestSimilar.js +101 -0
- package/node_modules/commander/package-support.json +16 -0
- package/node_modules/commander/package.json +82 -0
- package/node_modules/commander/typings/esm.d.mts +3 -0
- package/node_modules/commander/typings/index.d.ts +1113 -0
- package/package.json +100 -0
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
<h1 align="center">
|
|
2
|
+
<br>
|
|
3
|
+
<br>
|
|
4
|
+
<img width="320" src="media/logo.svg" alt="Chalk">
|
|
5
|
+
<br>
|
|
6
|
+
<br>
|
|
7
|
+
<br>
|
|
8
|
+
</h1>
|
|
9
|
+
|
|
10
|
+
> Terminal string styling done right
|
|
11
|
+
|
|
12
|
+
[](https://codecov.io/gh/chalk/chalk)
|
|
13
|
+
[](https://www.npmjs.com/package/chalk?activeTab=dependents)
|
|
14
|
+
[](https://www.npmjs.com/package/chalk)
|
|
15
|
+
|
|
16
|
+

|
|
17
|
+
|
|
18
|
+
## Info
|
|
19
|
+
|
|
20
|
+
- [Why not switch to a smaller coloring package?](https://github.com/chalk/chalk?tab=readme-ov-file#why-not-switch-to-a-smaller-coloring-package)
|
|
21
|
+
- See [yoctocolors](https://github.com/sindresorhus/yoctocolors) for a smaller alternative
|
|
22
|
+
|
|
23
|
+
## Highlights
|
|
24
|
+
|
|
25
|
+
- Expressive API
|
|
26
|
+
- Highly performant
|
|
27
|
+
- No dependencies
|
|
28
|
+
- Ability to nest styles
|
|
29
|
+
- [256/Truecolor color support](#256-and-truecolor-color-support)
|
|
30
|
+
- Auto-detects color support
|
|
31
|
+
- Doesn't extend `String.prototype`
|
|
32
|
+
- Clean and focused
|
|
33
|
+
- Actively maintained
|
|
34
|
+
- [Used by ~115,000 packages](https://www.npmjs.com/browse/depended/chalk) as of July 4, 2024
|
|
35
|
+
|
|
36
|
+
## Install
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
npm install chalk
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**IMPORTANT:** Chalk 5 is ESM. If you want to use Chalk with TypeScript or a build tool, you will probably want to use Chalk 4 for now. [Read more.](https://github.com/chalk/chalk/releases/tag/v5.0.0)
|
|
43
|
+
|
|
44
|
+
## Usage
|
|
45
|
+
|
|
46
|
+
```js
|
|
47
|
+
import chalk from 'chalk';
|
|
48
|
+
|
|
49
|
+
console.log(chalk.blue('Hello world!'));
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Chalk comes with an easy to use composable API where you just chain and nest the styles you want.
|
|
53
|
+
|
|
54
|
+
```js
|
|
55
|
+
import chalk from 'chalk';
|
|
56
|
+
|
|
57
|
+
const log = console.log;
|
|
58
|
+
|
|
59
|
+
// Combine styled and normal strings
|
|
60
|
+
log(chalk.blue('Hello') + ' World' + chalk.red('!'));
|
|
61
|
+
|
|
62
|
+
// Compose multiple styles using the chainable API
|
|
63
|
+
log(chalk.blue.bgRed.bold('Hello world!'));
|
|
64
|
+
|
|
65
|
+
// Pass in multiple arguments
|
|
66
|
+
log(chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz'));
|
|
67
|
+
|
|
68
|
+
// Nest styles
|
|
69
|
+
log(chalk.red('Hello', chalk.underline.bgBlue('world') + '!'));
|
|
70
|
+
|
|
71
|
+
// Nest styles of the same type even (color, underline, background)
|
|
72
|
+
log(chalk.green(
|
|
73
|
+
'I am a green line ' +
|
|
74
|
+
chalk.blue.underline.bold('with a blue substring') +
|
|
75
|
+
' that becomes green again!'
|
|
76
|
+
));
|
|
77
|
+
|
|
78
|
+
// ES2015 template literal
|
|
79
|
+
log(`
|
|
80
|
+
CPU: ${chalk.red('90%')}
|
|
81
|
+
RAM: ${chalk.green('40%')}
|
|
82
|
+
DISK: ${chalk.yellow('70%')}
|
|
83
|
+
`);
|
|
84
|
+
|
|
85
|
+
// Use RGB colors in terminal emulators that support it.
|
|
86
|
+
log(chalk.rgb(123, 45, 67).underline('Underlined reddish color'));
|
|
87
|
+
log(chalk.hex('#DEADED').bold('Bold gray!'));
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Easily define your own themes:
|
|
91
|
+
|
|
92
|
+
```js
|
|
93
|
+
import chalk from 'chalk';
|
|
94
|
+
|
|
95
|
+
const error = chalk.bold.red;
|
|
96
|
+
const warning = chalk.hex('#FFA500'); // Orange color
|
|
97
|
+
|
|
98
|
+
console.log(error('Error!'));
|
|
99
|
+
console.log(warning('Warning!'));
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Take advantage of console.log [string substitution](https://nodejs.org/docs/latest/api/console.html#console_console_log_data_args):
|
|
103
|
+
|
|
104
|
+
```js
|
|
105
|
+
import chalk from 'chalk';
|
|
106
|
+
|
|
107
|
+
const name = 'Sindre';
|
|
108
|
+
console.log(chalk.green('Hello %s'), name);
|
|
109
|
+
//=> 'Hello Sindre'
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## API
|
|
113
|
+
|
|
114
|
+
### chalk.`<style>[.<style>...](string, [string...])`
|
|
115
|
+
|
|
116
|
+
Example: `chalk.red.bold.underline('Hello', 'world');`
|
|
117
|
+
|
|
118
|
+
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`.
|
|
119
|
+
|
|
120
|
+
Multiple arguments will be separated by space.
|
|
121
|
+
|
|
122
|
+
### chalk.level
|
|
123
|
+
|
|
124
|
+
Specifies the level of color support.
|
|
125
|
+
|
|
126
|
+
Color support is automatically detected, but you can override it by setting the `level` property. You should however only do this in your own code as it applies globally to all Chalk consumers.
|
|
127
|
+
|
|
128
|
+
If you need to change this in a reusable module, create a new instance:
|
|
129
|
+
|
|
130
|
+
```js
|
|
131
|
+
import {Chalk} from 'chalk';
|
|
132
|
+
|
|
133
|
+
const customChalk = new Chalk({level: 0});
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
| Level | Description |
|
|
137
|
+
| :---: | :--- |
|
|
138
|
+
| `0` | All colors disabled |
|
|
139
|
+
| `1` | Basic color support (16 colors) |
|
|
140
|
+
| `2` | 256 color support |
|
|
141
|
+
| `3` | Truecolor support (16 million colors) |
|
|
142
|
+
|
|
143
|
+
### supportsColor
|
|
144
|
+
|
|
145
|
+
Detect whether the terminal [supports color](https://github.com/chalk/supports-color). Used internally and handled for you, but exposed for convenience.
|
|
146
|
+
|
|
147
|
+
Can be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, use the environment variable `FORCE_COLOR=1` (level 1), `FORCE_COLOR=2` (level 2), or `FORCE_COLOR=3` (level 3) to forcefully enable color, or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks.
|
|
148
|
+
|
|
149
|
+
Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively.
|
|
150
|
+
|
|
151
|
+
### chalkStderr and supportsColorStderr
|
|
152
|
+
|
|
153
|
+
`chalkStderr` contains a separate instance configured with color support detected for `stderr` stream instead of `stdout`. Override rules from `supportsColor` apply to this too. `supportsColorStderr` is exposed for convenience.
|
|
154
|
+
|
|
155
|
+
### modifierNames, foregroundColorNames, backgroundColorNames, and colorNames
|
|
156
|
+
|
|
157
|
+
All supported style strings are exposed as an array of strings for convenience. `colorNames` is the combination of `foregroundColorNames` and `backgroundColorNames`.
|
|
158
|
+
|
|
159
|
+
This can be useful if you wrap Chalk and need to validate input:
|
|
160
|
+
|
|
161
|
+
```js
|
|
162
|
+
import {modifierNames, foregroundColorNames} from 'chalk';
|
|
163
|
+
|
|
164
|
+
console.log(modifierNames.includes('bold'));
|
|
165
|
+
//=> true
|
|
166
|
+
|
|
167
|
+
console.log(foregroundColorNames.includes('pink'));
|
|
168
|
+
//=> false
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## Styles
|
|
172
|
+
|
|
173
|
+
### Modifiers
|
|
174
|
+
|
|
175
|
+
- `reset` - Reset the current style.
|
|
176
|
+
- `bold` - Make the text bold.
|
|
177
|
+
- `dim` - Make the text have lower opacity.
|
|
178
|
+
- `italic` - Make the text italic. *(Not widely supported)*
|
|
179
|
+
- `underline` - Put a horizontal line below the text. *(Not widely supported)*
|
|
180
|
+
- `overline` - Put a horizontal line above the text. *(Not widely supported)*
|
|
181
|
+
- `inverse`- Invert background and foreground colors.
|
|
182
|
+
- `hidden` - Print the text but make it invisible.
|
|
183
|
+
- `strikethrough` - Puts a horizontal line through the center of the text. *(Not widely supported)*
|
|
184
|
+
- `visible`- Print the text only when Chalk has a color level above zero. Can be useful for things that are purely cosmetic.
|
|
185
|
+
|
|
186
|
+
### Colors
|
|
187
|
+
|
|
188
|
+
- `black`
|
|
189
|
+
- `red`
|
|
190
|
+
- `green`
|
|
191
|
+
- `yellow`
|
|
192
|
+
- `blue`
|
|
193
|
+
- `magenta`
|
|
194
|
+
- `cyan`
|
|
195
|
+
- `white`
|
|
196
|
+
- `blackBright` (alias: `gray`, `grey`)
|
|
197
|
+
- `redBright`
|
|
198
|
+
- `greenBright`
|
|
199
|
+
- `yellowBright`
|
|
200
|
+
- `blueBright`
|
|
201
|
+
- `magentaBright`
|
|
202
|
+
- `cyanBright`
|
|
203
|
+
- `whiteBright`
|
|
204
|
+
|
|
205
|
+
### Background colors
|
|
206
|
+
|
|
207
|
+
- `bgBlack`
|
|
208
|
+
- `bgRed`
|
|
209
|
+
- `bgGreen`
|
|
210
|
+
- `bgYellow`
|
|
211
|
+
- `bgBlue`
|
|
212
|
+
- `bgMagenta`
|
|
213
|
+
- `bgCyan`
|
|
214
|
+
- `bgWhite`
|
|
215
|
+
- `bgBlackBright` (alias: `bgGray`, `bgGrey`)
|
|
216
|
+
- `bgRedBright`
|
|
217
|
+
- `bgGreenBright`
|
|
218
|
+
- `bgYellowBright`
|
|
219
|
+
- `bgBlueBright`
|
|
220
|
+
- `bgMagentaBright`
|
|
221
|
+
- `bgCyanBright`
|
|
222
|
+
- `bgWhiteBright`
|
|
223
|
+
|
|
224
|
+
## 256 and Truecolor color support
|
|
225
|
+
|
|
226
|
+
Chalk supports 256 colors and [Truecolor](https://github.com/termstandard/colors) (16 million colors) on supported terminal apps.
|
|
227
|
+
|
|
228
|
+
Colors are downsampled from 16 million RGB values to an ANSI color format that is supported by the terminal emulator (or by specifying `{level: n}` as a Chalk option). For example, Chalk configured to run at level 1 (basic color support) will downsample an RGB value of #FF0000 (red) to 31 (ANSI escape for red).
|
|
229
|
+
|
|
230
|
+
Examples:
|
|
231
|
+
|
|
232
|
+
- `chalk.hex('#DEADED').underline('Hello, world!')`
|
|
233
|
+
- `chalk.rgb(15, 100, 204).inverse('Hello!')`
|
|
234
|
+
|
|
235
|
+
Background versions of these models are prefixed with `bg` and the first level of the module capitalized (e.g. `hex` for foreground colors and `bgHex` for background colors).
|
|
236
|
+
|
|
237
|
+
- `chalk.bgHex('#DEADED').underline('Hello, world!')`
|
|
238
|
+
- `chalk.bgRgb(15, 100, 204).inverse('Hello!')`
|
|
239
|
+
|
|
240
|
+
The following color models can be used:
|
|
241
|
+
|
|
242
|
+
- [`rgb`](https://en.wikipedia.org/wiki/RGB_color_model) - Example: `chalk.rgb(255, 136, 0).bold('Orange!')`
|
|
243
|
+
- [`hex`](https://en.wikipedia.org/wiki/Web_colors#Hex_triplet) - Example: `chalk.hex('#FF8800').bold('Orange!')`
|
|
244
|
+
- [`ansi256`](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) - Example: `chalk.bgAnsi256(194)('Honeydew, more or less')`
|
|
245
|
+
|
|
246
|
+
## Browser support
|
|
247
|
+
|
|
248
|
+
Since Chrome 69, ANSI escape codes are natively supported in the developer console.
|
|
249
|
+
|
|
250
|
+
## Windows
|
|
251
|
+
|
|
252
|
+
If you're on Windows, do yourself a favor and use [Windows Terminal](https://github.com/microsoft/terminal) instead of `cmd.exe`.
|
|
253
|
+
|
|
254
|
+
## FAQ
|
|
255
|
+
|
|
256
|
+
### Why not switch to a smaller coloring package?
|
|
257
|
+
|
|
258
|
+
Chalk may be larger, but there is a reason for that. It offers a more user-friendly API, well-documented types, supports millions of colors, and covers edge cases that smaller alternatives miss. Chalk is mature, reliable, and built to last.
|
|
259
|
+
|
|
260
|
+
But beyond the technical aspects, there's something more critical: trust and long-term maintenance. I have been active in open source for over a decade, and I'm committed to keeping Chalk maintained. Smaller packages might seem appealing now, but there's no guarantee they will be around for the long term, or that they won't become malicious over time.
|
|
261
|
+
|
|
262
|
+
Chalk is also likely already in your dependency tree (since 100K+ packages depend on it), so switching won’t save space—in fact, it might increase it. npm deduplicates dependencies, so multiple Chalk instances turn into one, but adding another package alongside it will increase your overall size.
|
|
263
|
+
|
|
264
|
+
If the goal is to clean up the ecosystem, switching away from Chalk won’t even make a dent. The real problem lies with packages that have very deep dependency trees (for example, those including a lot of polyfills). Chalk has no dependencies. It's better to focus on impactful changes rather than minor optimizations.
|
|
265
|
+
|
|
266
|
+
If absolute package size is important to you, I also maintain [yoctocolors](https://github.com/sindresorhus/yoctocolors), one of the smallest color packages out there.
|
|
267
|
+
|
|
268
|
+
*\- [Sindre](https://github.com/sindresorhus)*
|
|
269
|
+
|
|
270
|
+
### But the smaller coloring package has benchmarks showing it is faster
|
|
271
|
+
|
|
272
|
+
[Micro-benchmarks are flawed](https://sindresorhus.com/blog/micro-benchmark-fallacy) because they measure performance in unrealistic, isolated scenarios, often giving a distorted view of real-world performance. Don't believe marketing fluff. All the coloring packages are more than fast enough.
|
|
273
|
+
|
|
274
|
+
## Related
|
|
275
|
+
|
|
276
|
+
- [chalk-template](https://github.com/chalk/chalk-template) - [Tagged template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#tagged_templates) support for this module
|
|
277
|
+
- [chalk-cli](https://github.com/chalk/chalk-cli) - CLI for this module
|
|
278
|
+
- [ansi-styles](https://github.com/chalk/ansi-styles) - ANSI escape codes for styling strings in the terminal
|
|
279
|
+
- [supports-color](https://github.com/chalk/supports-color) - Detect whether a terminal supports color
|
|
280
|
+
- [strip-ansi](https://github.com/chalk/strip-ansi) - Strip ANSI escape codes
|
|
281
|
+
- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Strip ANSI escape codes from a stream
|
|
282
|
+
- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes
|
|
283
|
+
- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes
|
|
284
|
+
- [wrap-ansi](https://github.com/chalk/wrap-ansi) - Wordwrap a string with ANSI escape codes
|
|
285
|
+
- [slice-ansi](https://github.com/chalk/slice-ansi) - Slice a string with ANSI escape codes
|
|
286
|
+
- [color-convert](https://github.com/qix-/color-convert) - Converts colors between different models
|
|
287
|
+
- [chalk-animation](https://github.com/bokub/chalk-animation) - Animate strings in the terminal
|
|
288
|
+
- [gradient-string](https://github.com/bokub/gradient-string) - Apply color gradients to strings
|
|
289
|
+
- [chalk-pipe](https://github.com/LitoMore/chalk-pipe) - Create chalk style schemes with simpler style strings
|
|
290
|
+
- [terminal-link](https://github.com/sindresorhus/terminal-link) - Create clickable links in the terminal
|
|
291
|
+
|
|
292
|
+
*(Not accepting additional entries)*
|
|
293
|
+
|
|
294
|
+
## Maintainers
|
|
295
|
+
|
|
296
|
+
- [Sindre Sorhus](https://github.com/sindresorhus)
|
|
297
|
+
- [Josh Junon](https://github.com/qix-)
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
// TODO: Make it this when TS suports that.
|
|
2
|
+
// import {ModifierName, ForegroundColor, BackgroundColor, ColorName} from '#ansi-styles';
|
|
3
|
+
// import {ColorInfo, ColorSupportLevel} from '#supports-color';
|
|
4
|
+
import {
|
|
5
|
+
ModifierName,
|
|
6
|
+
ForegroundColorName,
|
|
7
|
+
BackgroundColorName,
|
|
8
|
+
ColorName,
|
|
9
|
+
} from './vendor/ansi-styles/index.js';
|
|
10
|
+
import {ColorInfo, ColorSupportLevel} from './vendor/supports-color/index.js';
|
|
11
|
+
|
|
12
|
+
export interface Options {
|
|
13
|
+
/**
|
|
14
|
+
Specify the color support for Chalk.
|
|
15
|
+
|
|
16
|
+
By default, color support is automatically detected based on the environment.
|
|
17
|
+
|
|
18
|
+
Levels:
|
|
19
|
+
- `0` - All colors disabled.
|
|
20
|
+
- `1` - Basic 16 colors support.
|
|
21
|
+
- `2` - ANSI 256 colors support.
|
|
22
|
+
- `3` - Truecolor 16 million colors support.
|
|
23
|
+
*/
|
|
24
|
+
readonly level?: ColorSupportLevel;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
Return a new Chalk instance.
|
|
29
|
+
*/
|
|
30
|
+
export const Chalk: new (options?: Options) => ChalkInstance; // eslint-disable-line @typescript-eslint/naming-convention
|
|
31
|
+
|
|
32
|
+
export interface ChalkInstance {
|
|
33
|
+
(...text: unknown[]): string;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
The color support for Chalk.
|
|
37
|
+
|
|
38
|
+
By default, color support is automatically detected based on the environment.
|
|
39
|
+
|
|
40
|
+
Levels:
|
|
41
|
+
- `0` - All colors disabled.
|
|
42
|
+
- `1` - Basic 16 colors support.
|
|
43
|
+
- `2` - ANSI 256 colors support.
|
|
44
|
+
- `3` - Truecolor 16 million colors support.
|
|
45
|
+
*/
|
|
46
|
+
level: ColorSupportLevel;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
Use RGB values to set text color.
|
|
50
|
+
|
|
51
|
+
@example
|
|
52
|
+
```
|
|
53
|
+
import chalk from 'chalk';
|
|
54
|
+
|
|
55
|
+
chalk.rgb(222, 173, 237);
|
|
56
|
+
```
|
|
57
|
+
*/
|
|
58
|
+
rgb: (red: number, green: number, blue: number) => this;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
Use HEX value to set text color.
|
|
62
|
+
|
|
63
|
+
@param color - Hexadecimal value representing the desired color.
|
|
64
|
+
|
|
65
|
+
@example
|
|
66
|
+
```
|
|
67
|
+
import chalk from 'chalk';
|
|
68
|
+
|
|
69
|
+
chalk.hex('#DEADED');
|
|
70
|
+
```
|
|
71
|
+
*/
|
|
72
|
+
hex: (color: string) => this;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
Use an [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color.
|
|
76
|
+
|
|
77
|
+
@example
|
|
78
|
+
```
|
|
79
|
+
import chalk from 'chalk';
|
|
80
|
+
|
|
81
|
+
chalk.ansi256(201);
|
|
82
|
+
```
|
|
83
|
+
*/
|
|
84
|
+
ansi256: (index: number) => this;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
Use RGB values to set background color.
|
|
88
|
+
|
|
89
|
+
@example
|
|
90
|
+
```
|
|
91
|
+
import chalk from 'chalk';
|
|
92
|
+
|
|
93
|
+
chalk.bgRgb(222, 173, 237);
|
|
94
|
+
```
|
|
95
|
+
*/
|
|
96
|
+
bgRgb: (red: number, green: number, blue: number) => this;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
Use HEX value to set background color.
|
|
100
|
+
|
|
101
|
+
@param color - Hexadecimal value representing the desired color.
|
|
102
|
+
|
|
103
|
+
@example
|
|
104
|
+
```
|
|
105
|
+
import chalk from 'chalk';
|
|
106
|
+
|
|
107
|
+
chalk.bgHex('#DEADED');
|
|
108
|
+
```
|
|
109
|
+
*/
|
|
110
|
+
bgHex: (color: string) => this;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set background color.
|
|
114
|
+
|
|
115
|
+
@example
|
|
116
|
+
```
|
|
117
|
+
import chalk from 'chalk';
|
|
118
|
+
|
|
119
|
+
chalk.bgAnsi256(201);
|
|
120
|
+
```
|
|
121
|
+
*/
|
|
122
|
+
bgAnsi256: (index: number) => this;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
Modifier: Reset the current style.
|
|
126
|
+
*/
|
|
127
|
+
readonly reset: this;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
Modifier: Make the text bold.
|
|
131
|
+
*/
|
|
132
|
+
readonly bold: this;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
Modifier: Make the text have lower opacity.
|
|
136
|
+
*/
|
|
137
|
+
readonly dim: this;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
Modifier: Make the text italic. *(Not widely supported)*
|
|
141
|
+
*/
|
|
142
|
+
readonly italic: this;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
Modifier: Put a horizontal line below the text. *(Not widely supported)*
|
|
146
|
+
*/
|
|
147
|
+
readonly underline: this;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
Modifier: Put a horizontal line above the text. *(Not widely supported)*
|
|
151
|
+
*/
|
|
152
|
+
readonly overline: this;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
Modifier: Invert background and foreground colors.
|
|
156
|
+
*/
|
|
157
|
+
readonly inverse: this;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
Modifier: Print the text but make it invisible.
|
|
161
|
+
*/
|
|
162
|
+
readonly hidden: this;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
Modifier: Puts a horizontal line through the center of the text. *(Not widely supported)*
|
|
166
|
+
*/
|
|
167
|
+
readonly strikethrough: this;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
Modifier: Print the text only when Chalk has a color level above zero.
|
|
171
|
+
|
|
172
|
+
Can be useful for things that are purely cosmetic.
|
|
173
|
+
*/
|
|
174
|
+
readonly visible: this;
|
|
175
|
+
|
|
176
|
+
readonly black: this;
|
|
177
|
+
readonly red: this;
|
|
178
|
+
readonly green: this;
|
|
179
|
+
readonly yellow: this;
|
|
180
|
+
readonly blue: this;
|
|
181
|
+
readonly magenta: this;
|
|
182
|
+
readonly cyan: this;
|
|
183
|
+
readonly white: this;
|
|
184
|
+
|
|
185
|
+
/*
|
|
186
|
+
Alias for `blackBright`.
|
|
187
|
+
*/
|
|
188
|
+
readonly gray: this;
|
|
189
|
+
|
|
190
|
+
/*
|
|
191
|
+
Alias for `blackBright`.
|
|
192
|
+
*/
|
|
193
|
+
readonly grey: this;
|
|
194
|
+
|
|
195
|
+
readonly blackBright: this;
|
|
196
|
+
readonly redBright: this;
|
|
197
|
+
readonly greenBright: this;
|
|
198
|
+
readonly yellowBright: this;
|
|
199
|
+
readonly blueBright: this;
|
|
200
|
+
readonly magentaBright: this;
|
|
201
|
+
readonly cyanBright: this;
|
|
202
|
+
readonly whiteBright: this;
|
|
203
|
+
|
|
204
|
+
readonly bgBlack: this;
|
|
205
|
+
readonly bgRed: this;
|
|
206
|
+
readonly bgGreen: this;
|
|
207
|
+
readonly bgYellow: this;
|
|
208
|
+
readonly bgBlue: this;
|
|
209
|
+
readonly bgMagenta: this;
|
|
210
|
+
readonly bgCyan: this;
|
|
211
|
+
readonly bgWhite: this;
|
|
212
|
+
|
|
213
|
+
/*
|
|
214
|
+
Alias for `bgBlackBright`.
|
|
215
|
+
*/
|
|
216
|
+
readonly bgGray: this;
|
|
217
|
+
|
|
218
|
+
/*
|
|
219
|
+
Alias for `bgBlackBright`.
|
|
220
|
+
*/
|
|
221
|
+
readonly bgGrey: this;
|
|
222
|
+
|
|
223
|
+
readonly bgBlackBright: this;
|
|
224
|
+
readonly bgRedBright: this;
|
|
225
|
+
readonly bgGreenBright: this;
|
|
226
|
+
readonly bgYellowBright: this;
|
|
227
|
+
readonly bgBlueBright: this;
|
|
228
|
+
readonly bgMagentaBright: this;
|
|
229
|
+
readonly bgCyanBright: this;
|
|
230
|
+
readonly bgWhiteBright: this;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
Main Chalk object that allows to chain styles together.
|
|
235
|
+
|
|
236
|
+
Call the last one as a method with a string argument.
|
|
237
|
+
|
|
238
|
+
Order doesn't matter, and later styles take precedent in case of a conflict.
|
|
239
|
+
|
|
240
|
+
This simply means that `chalk.red.yellow.green` is equivalent to `chalk.green`.
|
|
241
|
+
*/
|
|
242
|
+
declare const chalk: ChalkInstance;
|
|
243
|
+
|
|
244
|
+
export const supportsColor: ColorInfo;
|
|
245
|
+
|
|
246
|
+
export const chalkStderr: typeof chalk;
|
|
247
|
+
export const supportsColorStderr: typeof supportsColor;
|
|
248
|
+
|
|
249
|
+
export {
|
|
250
|
+
ModifierName, ForegroundColorName, BackgroundColorName, ColorName,
|
|
251
|
+
modifierNames, foregroundColorNames, backgroundColorNames, colorNames,
|
|
252
|
+
// } from '#ansi-styles';
|
|
253
|
+
} from './vendor/ansi-styles/index.js';
|
|
254
|
+
|
|
255
|
+
export {
|
|
256
|
+
ColorInfo,
|
|
257
|
+
ColorSupport,
|
|
258
|
+
ColorSupportLevel,
|
|
259
|
+
// } from '#supports-color';
|
|
260
|
+
} from './vendor/supports-color/index.js';
|
|
261
|
+
|
|
262
|
+
// TODO: Remove these aliases in the next major version
|
|
263
|
+
/**
|
|
264
|
+
@deprecated Use `ModifierName` instead.
|
|
265
|
+
|
|
266
|
+
Basic modifier names.
|
|
267
|
+
*/
|
|
268
|
+
export type Modifiers = ModifierName;
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
@deprecated Use `ForegroundColorName` instead.
|
|
272
|
+
|
|
273
|
+
Basic foreground color names.
|
|
274
|
+
|
|
275
|
+
[More colors here.](https://github.com/chalk/chalk/blob/main/readme.md#256-and-truecolor-color-support)
|
|
276
|
+
*/
|
|
277
|
+
export type ForegroundColor = ForegroundColorName;
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
@deprecated Use `BackgroundColorName` instead.
|
|
281
|
+
|
|
282
|
+
Basic background color names.
|
|
283
|
+
|
|
284
|
+
[More colors here.](https://github.com/chalk/chalk/blob/main/readme.md#256-and-truecolor-color-support)
|
|
285
|
+
*/
|
|
286
|
+
export type BackgroundColor = BackgroundColorName;
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
@deprecated Use `ColorName` instead.
|
|
290
|
+
|
|
291
|
+
Basic color names. The combination of foreground and background color names.
|
|
292
|
+
|
|
293
|
+
[More colors here.](https://github.com/chalk/chalk/blob/main/readme.md#256-and-truecolor-color-support)
|
|
294
|
+
*/
|
|
295
|
+
export type Color = ColorName;
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
@deprecated Use `modifierNames` instead.
|
|
299
|
+
|
|
300
|
+
Basic modifier names.
|
|
301
|
+
*/
|
|
302
|
+
export const modifiers: readonly Modifiers[];
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
@deprecated Use `foregroundColorNames` instead.
|
|
306
|
+
|
|
307
|
+
Basic foreground color names.
|
|
308
|
+
*/
|
|
309
|
+
export const foregroundColors: readonly ForegroundColor[];
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
@deprecated Use `backgroundColorNames` instead.
|
|
313
|
+
|
|
314
|
+
Basic background color names.
|
|
315
|
+
*/
|
|
316
|
+
export const backgroundColors: readonly BackgroundColor[];
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
@deprecated Use `colorNames` instead.
|
|
320
|
+
|
|
321
|
+
Basic color names. The combination of foreground and background color names.
|
|
322
|
+
*/
|
|
323
|
+
export const colors: readonly Color[];
|
|
324
|
+
|
|
325
|
+
export default chalk;
|