Skip to content
Agents tracked: 506 Releases (7d): 634 Agent status: 3 with issuesSince last limit reset: Claude 15d · Codex 0d For AI agents: Markdown Updated Nov 26, 2026

picocolors

Colored text for command-line tools.

Dev workflow and configNPM

GitHubWebsite

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/LICENSE

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

63 / 100
Gid Score, #789 overall
358M
downloads a week, npm
1,757
GitHub stars
15
agent projects use it
picocolors: downloads per weeknpm, picocolors 358,023,407
picocolors: GitHub starsalexeyraspopov/picocolors 1,757

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

12 projects, 0.4%
5 projects, 1.1%
5 projects, 0.2%

Often used with

In 50.0% of its projects
In 91.7% of its projects
In 38.5% of its projects
In 31.2% of its projects
In 51.0% of its projects
In 55.2% of its projects
In 24.0% of its projects
In 22.9% of its projects

More about picocolors

More in Dev workflow and config

Alternatives

picocolors This page

ISCGid 63358M/wk

chalk

Pick chalk when you want chained styles (chalk.red.bold) or exact hex colors; current chalk 6 needs Node.js 22 and ESM.

MITGid 8066M/wk

Consola

Pick Consola when you want ready log levels and formatted messages, not just colored strings.

Rich

Pick Rich when the command-line tool is written in Python.

Compare picocolors with another tool

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.”

  1. 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

  2. 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

pc.red.bold("Failed")
pc.red(pc.bold("Failed"))

picocolors functions are plain functions without chained properties; chalk-style chains do not exist.

pc.hex("#2B59C3")("Brand") or pc.rgb(...)
Use one of the 16 named colors (pc.blue, pc.cyanBright ...) or switch to chalk for exact colors

The README lists only named colors, backgrounds and styles; there is no hex or rgb function.

Expecting colored strings in a web page or browser console after bundling
Use picocolors only for terminal output; style web pages with CSS

The package's browser entry maps to a build where every function returns the plain string.

Writing pc.red(...) results into a JSON log or a file that other programs read
Make a plain set with pc.createColors(false) for anything that is not shown in a terminal

With colors on, the strings carry escape codes; in our run line 4 came back as "\u001b[31m\u001b[1m✖ Upload failed:..."

Colors missing in CI logs and adding chalk just to force them
Set FORCE_COLOR=1 (or pass --color) in the CI job; CI=true alone already turns them on

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.