Compare the features of most popular libraries

March 11, 2026 ยท View on GitHub

Library Colors support Features
- ESM | CJS
- named import
- naming colors
16 | 256 | 16m | ๐ŸŒ Fallback Chained
syntax
Nested
template
strings
`${}`
LF
\n
Supports
ENV vars
CLI flags
ansis
ESM CJS
โœ… named import
โœ… standard
โœ… โœ… โœ… โœ… โ†’256
โ†’16
โ†’b&w
โœ… โœ… โœ… NO_COLOR
FORCE_COLOR
COLORTERM
--no-color
--color
chalk v5
ESM
โŒ named import
โœ… standard
โœ… โœ… โœ… โœ… โ†’256
โ†’16
โ†’b&w
โœ… โŒ โœ… NO_COLOR
FORCE_COLOR
--no-color
--color
kolorist
ESM CJS
โœ… named import
โŒ standard
โœ… โœ… โœ… โŒ โ†’256
โ†’b&w
โŒ โŒ โŒ NO_COLOR
FORCE_COLOR
cli-color
CJS
โŒ named import
โœ… standard
โœ… โœ… โŒ ๐Ÿ›‘ โ†’16
โ†’b&w
โœ… โŒ โŒ NO_COLOR
colors-cli
CJS
โŒ named import
โŒ standard
โœ… โœ… โŒ ๐Ÿ›‘ โ†’b&w โœ… โŒ โœ… --no-color
--color
colors.js
CJS
โŒ named import
โŒ standard
โœ… โŒ โŒ ๐Ÿ›‘ โ†’b&w โœ… โŒ โœ… FORCE_COLOR
--no-color
--color
ansi-colors
CJS
โŒ named import
โœ… standard
โœ… โŒ โŒ โŒ โŒ โœ… โŒ โœ… FORCE_COLOR
colorette
ESM CJS
โœ… named import
โœ… standard
โœ… โŒ โŒ ๐Ÿ›‘ โ†’b&w โŒ โŒ โŒ NO_COLOR
FORCE_COLOR
--no-color
--color
picocolors
CJS
โŒ named import
โœ… standard
โœ… โŒ โŒ โŒ โ†’b&w โŒ โŒ โŒ NO_COLOR
FORCE_COLOR
--no-color
--color
tinyrainbow
ESM
โŒ named import
โœ… standard
โœ… โŒ โŒ โœ… โ†’b&w โŒ โŒ โŒ NO_COLOR
FORCE_COLOR
FORCE_TTY
--no-color
--color
kleur
ESM CJS
โœ… named import
โœ… standard
โŒ โŒ โŒ โœ…
8 colors
โ†’b&w โœ… โŒ โŒ NO_COLOR
FORCE_COLOR
util.styleText()
Node โ‰ฅ 22
โŒ named import
โœ… standard
โœ… โŒ โŒ ๐Ÿ›‘ โ†’b&w โŒ โŒ ? NO_COLOR
FORCE_COLOR

Legend

Named import

  • ESM: import { red, green, blue } from 'lib';
  • CJS: const { red, green, blue } = require('lib');

Naming colors

  • standard: colors have standard names, e.g.: red, redBright, bgRed, bgRedBright
  • non-standard: colors have lib-specific names, e.g.: brightRed, bgBrightRed, red_b, red_btt

Colors support

  • 16 - ANSI 16 colors like red, redBright, bgRed, bgRedBright

  • 256 - ANSI 256 colors methods, e.g.:

    • [ansis][ansis]: fg(n), bg(n)
    • [chalk][chalk]: ansi256(n), bgAnsi256(n)
    • [cli-color][cli-color]: xterm(n)
    • [colors-cli][colors-cli]: x<n>
  • 16m - Truecolor methods, e.g.: hex(), bgHex(), rgb(), bgRgb()

  • ๐ŸŒ - Colored output in Chromium-based browser console:

    • โœ… - colored output
    • โŒ - b&w output
    • ๐Ÿ›‘ - fatal error by compilation or in runtime
  • Fallback - Truecolor โ†’ 256 colors โ†’ 16 colors โ†’ no colors

Features

  • Chained syntax - lib.red.bold('text')

  • Nested templates - lib.red`text ${lib.cyan`nested`} text`

  • LF - correct style break at \n:

    console.log(bgGreen('\nAnsis\nNew Line\nNext New Line\n'))
    

    Outputs:
    output