picocolors

Tiny, zero-dependency terminal output formatting with ANSI colors.

picocolors

General JS

Tiny, zero-dependency terminal output formatting with ANSI colors.

Fit

Bundle (gzip)

383 B

719 B raw

Install size includes transitive dependencies. Bundle size is gzipped browser payload.

Freshness

The Problem

Terminal logging and CLI output often need lightweight color formatting, but many color libraries are large or require too many dependencies.

What It Does

picocolors provides a tiny API for ANSI color styling in console output. It focuses on speed, zero dependencies, and minimal bundle size for Node.js and CLI tools.

Installation

bash
npm install picocolors

Usage Example

js
import { green, red, bold } from "picocolors";

console.log(green("Success:"), bold("Deployment complete."));
console.error(red("Error:"), "Unable to connect to the database.");

Related packages