@@ -33,7 +33,7 @@ Ansis is focused on [small size](#compare-size) and [speed](#benchmark) while pr
33
33
34
34
<a id =" features " name =" features " ></a >
35
35
36
- ## 💡 Highlights
36
+ ## 💡 Features
37
37
38
38
- Supports ** ESM** , ** CommonJS** , ** Bun** , ** Deno** , ** Next.JS**
39
39
- Works in [ Chromium-based] ( #browsers-compatibility ) browsers such as ** Chrome** , ** Edge** , ** Opera** , ** Brave** , ** Vivaldi**
@@ -112,7 +112,7 @@ The package size in `node_modules` directory:
112
112
- ` chalk ` : Slower than both ** Ansis** and ** Picocolors** in all use cases.
113
113
114
114
> [ !CAUTION]
115
- > ** Picocolors** doesn't handle important ** edge cases** , so it is the fastest and smallest .
115
+ > ** Picocolors** doesn't handle important ** edge cases** , so it is the fastest.
116
116
>
117
117
> ** Picocolors** is faster only in a [ simple] ( #bench-simple ) micro-benchmark, which does not reflect real world usage.\
118
118
> In a more complex benchmark, ** Ansis** is much [ closer] ( #bench-picocolors-complex ) to ** Picocolors** results or even [ faster] ( #bench-3-styles ) .
@@ -210,15 +210,15 @@ As of 2025, only **Ansis**, **Chalk**, and **Picocolors** are actively maintaine
210
210
- ✅ Ansis: ` ESM ` and ` CJS `
211
211
- ☑️ Picocolors: ` CJS ` only
212
212
- ☑️ Chalk: ` ESM ` only
213
- - Does it matter if a library performs [ ~ 60 million] ( #bench-simple ) or [ ~ 100 million] ( #bench-simple ) ** ops/sec** when outputting to the terminal?
214
- Spoiler: All libraries are more than [ fast enough] ( #bench-picocolors-complex ) .
215
- - ✅ Picocolors
216
- - ☑️ Ansis
217
- - ☑️ Chalk
218
213
- Does it matter the unpacked size?
219
214
- ✅ [ Ansis - 6.7 kB] [ npm-ansis ]
220
215
- ✅ [ Picocolors - 6.4 kB] [ npm-picocolors ]
221
216
- ❌ [ Chalk - 44.4 kB] [ npm-chalk ]
217
+ - Does it matter if a library performs [ ~ 60 million] ( #bench-simple ) or [ ~ 100 million] ( #bench-simple ) ** ops/sec** when outputting to the terminal?
218
+ Spoiler: All libraries are more than [ fast enough] ( #bench-picocolors-complex ) .
219
+ - ✅ Picocolors
220
+ - ✅ Ansis
221
+ - ✅ Chalk
222
222
- Does support for [ ANSI 256 colors] ( #256-colors ) or [ Truecolor] ( #truecolor ) with [ fallback] ( #fallback ) matter?
223
223
- ✅ Ansis
224
224
- ✅ Chalk
@@ -362,26 +362,26 @@ italic.bold.yellow.bgMagentaBright`text`;
362
362
363
363
## ANSI 16 colors
364
364
365
- | Standard Colors | Bright Colors | Standard Backgrounds | Bright Backgrounds |
366
- | :-----------------| :----------------| :---------------------| :-------------------|
367
- | ` black ` | ` gray ` | ` bgBlack ` | ` bgGray ` |
368
- | ` red ` | ` redBright ` | ` bgRed ` | ` bgRedBright ` |
369
- | ` green ` | ` greenBright ` | ` bgGreen ` | ` bgGreenBright ` |
370
- | ` yellow ` | ` yellowBright ` | ` bgYellow ` | ` bgYellowBright ` |
371
- | ` blue ` | ` blueBright ` | ` bgBlue ` | ` bgBlueBright ` |
372
- | ` magenta ` | ` magentaBright ` | ` bgMagenta ` | ` bgMagentaBright ` |
373
- | ` cyan ` | ` cyanBright ` | ` bgCyan ` | ` bgCyanBright ` |
374
- | ` white ` | ` whiteBright ` | ` bgWhite ` | ` bgWhiteBright ` |
365
+ There are 16 basic colors: 8 standard and 8 bright variants.
366
+
367
+ | Example | Color | Background | Bright Example | Bright Color | Bright Background |
368
+ | :---------------------------------:| :---------------| :--------------------| :---------------------------------------:| :----------------| :------------------|
369
+ | ![ ] ( docs/img/colors/black.png ) | ` black ` | ` bgBlack ` | ![ ] ( docs/img/colors/gray.png ) | ` gray ` | ` bgGray ` |
370
+ | ![ ] ( docs/img/colors/red.png ) | ` red ` | ` bgRed ` | ![ ] ( docs/img/colors/redBright.png ) | ` redBright ` | ` bgRedBright ` |
371
+ | ![ ] ( docs/img/colors/green.png ) | ` green ` | ` bgGreen ` | ![ ] ( docs/img/colors/greenBright.png ) | ` greenBright ` | ` bgGreenBright ` |
372
+ | ![ ] ( docs/img/colors/yellow.png ) | ` yellow ` | ` bgYellow ` | ![ ] ( docs/img/colors/yellowBright.png ) | ` yellowBright ` | ` bgYellowBright ` |
373
+ | ![ ] ( docs/img/colors/blue.png ) | ` blue ` | ` bgBlue ` | ![ ] ( docs/img/colors/blueBright.png ) | ` blueBright ` | ` bgBlueBright ` |
374
+ | ![ ] ( docs/img/colors/magenta.png ) | ` magenta ` | ` bgMagenta ` | ![ ] ( docs/img/colors/magentaBright.png ) | ` magentaBright ` | ` bgMagentaBright ` |
375
+ | ![ ] ( docs/img/colors/cyan.png ) | ` cyan ` | ` bgCyan ` | ![ ] ( docs/img/colors/cyanBright.png ) | ` cyanBright ` | ` bgCyanBright ` |
376
+ | ![ ] ( docs/img/colors/white.png ) | ` white ` | ` bgWhite ` | ![ ] ( docs/img/colors/whiteBright.png ) | ` whiteBright ` | ` bgWhiteBright ` |
375
377
376
- > [ !CAUTION]
377
- > The redundant ` grey ` , ` bgGrey ` , ` blackBright ` and ` bgBlackBright ` aliases for ` gray ` and ` bgGray ` are ** deprecated** .
378
378
379
379
<a name =" gray-naming-in-libs " ></a >
380
380
### Color naming in libraries: ` gray ` vs ` grey ` vs ` blackBright `
381
381
382
- The same ANSI codes ` 90 ` (_ gray_ ) and ` 100 ` (_ bgGray_ ) are referred to by different names and aliases in various libraries.
382
+ The same ANSI codes ` 90 ` (_ gray_ ) and ` 100 ` (_ bgGray_ ) are named differently in various libraries.
383
383
384
- | Library | Standard<br >` gray ` <br >` bgGray ` | UK- spelling<br >` grey ` <br >` bgGrey ` | Spec-style<br >  ; ` blackBright ` <br >` bgBlackBright ` |
384
+ | Library | Standard<br >` gray ` <br >` bgGray ` | UK spelling<br >` grey ` <br >` bgGrey ` | Spec-style<br >  ; ` blackBright ` <br >` bgBlackBright ` |
385
385
| :---------------------------| :------------------------------:| :---------------------------------:| :----------------------------------------------------:|
386
386
| [ ansis] [ ansis ] | ✅ | ❌ | ❌ |
387
387
| [ yoctocolors] [ yoctocolors ] | ✅ | ❌ | ❌ |
0 commit comments