npmbot.com
AI

picocolors

v1.1.1ISCTree-shakeableTS Ready

The tiniest and fastest library for formatting terminal text with ANSI colors.

99/ 100
Excellent Health
Weekly Downloads
48.0M
Bundle Size (gzip)
0.8 kB(1.9 kB min)
Dependencies
Zero Deps
Last Updated
2024-10-18
SPONSORED CLOUD & DEV TOOLSβ€’Google Ads Partner
NPMBot AI Assessment

The lightweight darling powering Vite, PostCSS, and modern build tools.

Picocolors was created to strip out all non-essential features from terminal colorizers. It delivers 14x faster execution than Chalk and loads in 0.8kB gzipped. It is trusted by Vite, Next.js, and ESLint.

Key Advantages
  • β€’Tiny: under 1 kB with zero dependencies
  • β€’14x faster than Chalk, near-zero startup penalty
  • β€’Works seamlessly in both CommonJS and ESM
Gotchas & Limitations
  • β€’No method chaining: uses functional style `pc.red(pc.bold('text'))`
  • β€’No 24-bit TrueColor RGB custom palettes
Recommended For:

Build tools, bundler plugins, and CLI scripts needing rapid startup

Avoid If:

Applications requiring rich nested RGB truecolor gradients

FEATURED PARTNERβ€’Google Ads Partner
Installation & Quickstart
Package Manager Command
javascript
npm install picocolors
picocolors Usage Example
javascript
import pc from 'picocolors';

console.log(pc.red(pc.bold('Error:')) + ' ' + pc.yellow('File not found'));
Compare picocolors with Alternatives