Compare the features of most popular libraries
March 11, 2026 ยท View on GitHub
| Library | Colors support | Features | ||||
|---|---|---|---|---|---|---|
ESM | CJS |
Fallback | Chained syntax |
Nested template strings `${}` |
LF\n |
Supports ENV vars CLI flags |
|
ansisESM CJSโ
named importโ
standard
|
โ โ โ โ | โ256 โ16 โb&w |
โ | โ | โ | NO_COLORFORCE_COLORCOLORTERM--no-color--color |
chalk v5ESMโ named importโ
standard |
โ โ โ โ | โ256 โ16 โb&w |
โ | โ | โ | NO_COLORFORCE_COLOR--no-color--color |
koloristESM CJSโ
named importโ standard |
โ โ โ โ | โ256 โb&w |
โ | โ | โ | NO_COLORFORCE_COLOR |
cli-colorCJSโ named importโ
standard |
โ โ โ ๐ | โ16 โb&w |
โ | โ | โ | NO_COLOR |
colors-cliCJSโ named importโ standard |
โ โ โ ๐ | โb&w | โ | โ | โ | --no-color--color |
colors.jsCJSโ named importโ standard |
โ โ โ ๐ | โb&w | โ | โ | โ | FORCE_COLOR--no-color--color |
ansi-colorsCJSโ named importโ
standard |
โ โ โ โ | โ | โ | โ | โ | FORCE_COLOR |
coloretteESM CJSโ
named importโ
standard |
โ โ โ ๐ | โb&w | โ | โ | โ | NO_COLORFORCE_COLOR--no-color--color |
picocolorsCJSโ named importโ
standard |
โ โ โ โ | โb&w | โ | โ | โ | NO_COLORFORCE_COLOR--no-color--color |
tinyrainbowESMโ named importโ
standard |
โ โ โ โ | โb&w | โ | โ | โ | NO_COLORFORCE_COLORFORCE_TTY--no-color--color |
kleurESM CJSโ
named importโ
standard |
โ โ โ โ
8 colors |
โb&w | โ | โ | โ | NO_COLORFORCE_COLOR |
util.styleText()Node โฅ 22โ named importโ
standard |
โ โ โ ๐ | โb&w | โ | โ | ? | NO_COLORFORCE_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 likered,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:
