1. License
“Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted”
ISC allows use in paid and closed tools.
github.com/alexeyraspopov/picocolors/blob/main/LICENSE3. Used by agents' projects
Dependency in 15 public GitHub projects set up for AI coding agents that we scanned (0.2%).
4. Agent access
Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.
From the package registry and GitHub, checked daily; card checked Nov 11, 2026. Tap a verdict to see its source.How we checkedReport an error
What picocolors does
picocolors is a very small free JavaScript library that paints text in the terminal, like a green tick for done or red for an error. Your own command-line tools and scripts become easier to read. It turns colors off by itself when the output goes to a file or the person asked for no color.
What people build with it
Readable build and deploy messages
A script that builds or deploys your site prints done in green, warnings in yellow and failures in red, so problems stand out in a long log.
A no-color option in your tool
Give people a switch that prints plain text, for screen readers, old terminals or saved logs.
Make a tool lighter by dropping chalk
A small tool that only needs a few colors can swap chalk for picocolors and keep the same output.
Respect people who turned color off
People who set NO_COLOR, or pass a no-color flag, get plain text from your tool without extra code.
Highlight results of a data script Idea
A one-off script that cleans a spreadsheet or checks links prints the rows it changed in green and the ones it skipped in gray.
picocolors popularity
Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated
How picocolors is used
- picocolors is a dependency in 15 of the 6,258 public GitHub projects set up for AI coding agents that we scanned, too few to describe it from them alone. Our scan also samples projects by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750); counting those, it appears in 96 projects, and what it is used with below comes from all of them.
- The most used alternative in our scan is chalk (181 projects).
- Projects that use it most often also use tsx (50.0%), TypeScript (91.7%), Clack Prompts (38.5%).
By coding agent
Often used with
More about picocolors
More in Dev workflow and config
Alternatives
picocolors This page
Pick chalk when you want chained styles (chalk.red.bold) or exact hex colors; current chalk 6 needs Node.js 22 and ESM.
Pick Consola when you want ready log levels and formatted messages, not just colored strings.
Pick Rich when the command-line tool is written in Python.
Get started
Tell your AI assistant
“Use picocolors (pin picocolors@1.1.1) for terminal colors in this Node.js script; nest calls like pc.red(pc.bold(text)), add a --no-color option with pc.createColors, and keep logs written to files free of colors.”
Add picocolors to your Node.js project with your package manager (npm install picocolors), then import it.
import pc from "picocolors"From github.com/alexeyraspopov/picocolors/blob/main/README.md
Wrap the text you print in a color or style function; nest calls to combine them.
console.log( pc.green(`How are ${pc.italic(`you`)} doing?`) )From github.com/alexeyraspopov/picocolors/blob/main/README.md
Mistakes to avoid
picocolors functions are plain functions without chained properties; chalk-style chains do not exist.
The README lists only named colors, backgrounds and styles; there is no hex or rgb function.
The package's browser entry maps to a build where every function returns the plain string.
With colors on, the strings carry escape codes; in our run line 4 came back as "\u001b[31m\u001b[1m✖ Upload failed:..."
picocolors checks FORCE_COLOR, --color, a terminal and CI before it turns colors on (our run showed true for CI=true).
Questions
Does it work with both require and import?
Yes. The README says it supports both CommonJS and ES module projects and ships TypeScript types.
Can I write chalk.red.bold style chains?
No. You nest calls instead, like pc.red(pc.bold(text)).
How do I know if colors will show?
Read pc.isColorSupported. It is false when NO_COLOR is set, with --no-color, or when output is not a terminal.
Can I use it in a commercial tool?
Yes. The ISC license allows any use with or without fee, as long as the notice stays with copies.