kleur

Tiny (3.9kB), fast Node.js library for terminal string styling with ANSI colors. Drop-in alternative to chalk with a chainable API and automatic NO_COLOR/FORCE_COLOR environment variable support. Uses template literal tags and a chainable API. Notably faster than chalk in benchmarks and has zero dependencies.

Evaluated Mar 06, 2026 (0d ago) v4+
Homepage ↗ Repo ↗ Developer Tools nodejs colors terminal ansi chalk-alternative fast esm lightweight
⚙ Agent Friendliness
69
/ 100
Can an agent use this?
🔒 Security
98
/ 100
Is it safe for agents?
⚡ Reliability
89
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
88
Error Messages
85
Auth Simplicity
100
Rate Limits
100

🔒 Security

TLS Enforcement
100
Auth Strength
100
Scope Granularity
100
Dep. Hygiene
95
Secret Handling
92

Zero-dependency terminal coloring library — no security concerns.

⚡ Reliability

Uptime/SLA
90
Version Stability
88
Breaking Changes
85
Error Recovery
92
AF Security Reliability

Best When

Building performance-sensitive Node.js CLI tools that need zero-dependency terminal coloring.

Avoid When

You're already using chalk or need tagged template literal syntax — chalk has better ecosystem support.

Use Cases

  • Add color and styling to Node.js CLI output with a zero-dependency, lightweight alternative to chalk
  • Style terminal output in performance-sensitive CLI tools where chalk's overhead is notable
  • Use as a chalk drop-in replacement in ESM projects without CommonJS compatibility issues
  • Apply multiple styles with chaining: kleur.bold().red().underline()('Error message')
  • Respect NO_COLOR environment variable automatically for accessible CLI tools

Not For

  • Complex template literal interpolation — chalk's tagged template literals (chalk`{red error}`) are more expressive
  • Browser environments — kleur uses ANSI escape codes which only work in terminals
  • Projects already using chalk where migration would be disruptive — chalk v5+ is ESM-first and well-maintained

Interface

REST API
No
GraphQL
No
gRPC
No
MCP Server
No
SDK
Yes
Webhooks
No

Authentication

Methods: none
OAuth: No Scopes: No

Library — no auth needed.

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

MIT licensed open source library.

Agent Metadata

Pagination
none
Idempotent
Full
Retry Guidance
Not documented

Known Gotchas

  • kleur v4 requires calling the function to get the string: kleur.red('text') — it's not a tagged template literal like chalk
  • Colors disabled by default when not in a TTY — set FORCE_COLOR=1 environment variable for piped output or CI environments
  • kleur is chainable but each chain link creates a new function call — store the style: const error = kleur.bold().red(); error('msg')
  • No support for chalk-style template literals ({red text}) — must use function call syntax: kleur.red('text')
  • Nested styles require explicit reset — mixing styles without proper closing may leak into surrounding output on some terminals
  • kleur uses CommonJS exports by default — in pure ESM projects, check the specific import syntax required

Alternatives

Full Evaluation Report

Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for kleur.

$99

Scores are editorial opinions as of 2026-03-06.

5215
Packages Evaluated
26151
Need Evaluation
173
Need Re-evaluation
Community Powered