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

chalk

Colored, bold and underlined text in the terminal.

Dev workflow and configNPM

GitHubWebsite

1. License

“to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software”

MIT allows use in paid and closed-source products.

github.com/chalk/chalk/blob/main/license

From the package registry and GitHub, checked daily; card checked Nov 10, 2026. Tap a verdict to see its source.How we checkedReport an error

What chalk does

chalk is a free JavaScript package that colors the messages a command-line program prints, so errors show in red and success in green. It checks whether the screen can show color and leaves plain text when it cannot. It styles terminal and browser console text, not the text on your web pages.

What people build with it

Readable build and deploy reports

Your deploy or setup script prints many lines; success turns green, warnings orange and errors bold red, so problems stand out at a glance.

Plain text in log files

When the same program writes to a log file or a build server, color codes would be clutter; chalk can be set to print plain text.

Your brand color in a command-line tool

A banner or prompt in your own command-line tool uses the exact hex color of your brand, not just the basic 16 colors.

Check color names users type

Your tool lets people pick colors in a settings file; check each name against chalk's own list before using it.

Separate colors for error output

Your program sends normal output to one place and errors to another; chalkStderr picks colors for the error stream on its own.

Highlight failed checks for an assistant Idea

A check script that your AI assistant runs prints failures in red and a short green summary, so you see the result in the chat log.

chalk popularity

80 / 100
Gid Score, #102 overall
66M
downloads a week, npm
23.3K
GitHub stars
181
agent projects use it
chalk: downloads per weeknpm, chalk 660,454,594
chalk: GitHub starschalk/chalk 23,346

Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated

How chalk is used

  • chalk is a dependency in 181 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (3.7% of the 4,867 JavaScript/TypeScript ones), #9 of 299 in dev workflow and config.
  • Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 570; those are left out of every share on this page.
  • Projects that use it most often also use Commander (64.6%), tsx (55.8%), dotenv (52.5%).
  • It is more common in projects set up for OpenClaw (14.1%) than for GitHub Copilot (2.2%).

By coding agent

126 projects, 3.8%
71 projects, 2.9%
67 projects, 2.2%
47 projects, 14.1%
30 projects, 6.3%
20 projects, 7.2%
15 projects, 3.2%
8 projects, 5.7%

Often used with

In 64.6% of its projects
In 55.8% of its projects
In 52.5% of its projects
In 58.6% of its projects
In 40.9% of its projects
In 61.3% of its projects
In 35.9% of its projects
In 35.4% of its projects

More about chalk

Funding
  • GitHub Sponsors: https://github.com/sindresorhus
  • GitHub Sponsors: https://github.com/Qix-
  • Open Collective: https://opencollective.com/sindresorhus
  • Tidelift: https://tidelift.com/funding/github/npm/chalk
  • Own page: https://sindresorhus.com/donate
  • Own page: https://github.com/chalk/chalk?sponsor=1
  • 186 GitHub sponsors

See all

Agent Skills for it
  • chalk-logic: Create Chalk Logic concept-led chalkboard illustrations from briefs. Use for sparse wordless chalkboard explanations, non-diagram editorial

See all

More in Dev workflow and config

Alternatives

chalk This page

MITGid 8066M/wk

picocolors

Pick picocolors when you only need basic terminal colors and want the smallest possible package.

Rich

Pick Rich when your command-line program is written in Python; it also draws tables and progress bars.

boxen

Pick boxen when you want a framed box around a message, such as an update notice; it can sit next to chalk.

Compare chalk with another tool

Get started

Tell your AI assistant

“Add chalk 6.0.1 as an exact dependency (Node.js 22+, ESM import) and color my CLI output with one theme object (green success, orange warnings, bold red errors), using new Chalk({ level }) instead of changing chalk.level globally.”

  1. Install chalk in a project that runs on Node.js 22 or newer.

    npm install chalk

    From github.com/chalk/chalk/releases/tag/v6.0.0

  2. Import it and wrap the text you print. Styles chain, and you can nest them.

    import chalk from 'chalk';
    
    console.log(chalk.blue('Hello world!'));
    

    From github.com/chalk/chalk/blob/main/readme.md

  3. To force colors on or off without code changes, set FORCE_COLOR when you run the program.

    FORCE_COLOR=0 node build.js

    From github.com/chalk/chalk/blob/main/readme.md

Mistakes to avoid

const chalk = require('chalk') in a CommonJS file or a TypeScript build that outputs CommonJS
Use import chalk from 'chalk' in an ESM file, or pin chalk@4 if the setup cannot load ESM

chalk 5 and later ship only as ESM.

npm install chalk on a project that runs Node.js 18 or 20
Run Node.js 22+, or pin chalk@5.6.2 on older Node.js

chalk 6.0.0 raised the minimum to Node.js 22 (package.json engines "node" ">=22").

chalk.level = 0 inside a library you publish
const customChalk = new Chalk({level: 0}) and use that instance

The level property is shared by every chalk user in the same program.

A loose version range, or 5.6.1 kept in an old lockfile
Pin an exact version (6.0.1) with a lockfile and remove 5.6.1 wherever it appears

5.6.1 was a harmful release pushed to the registry; 5.6.2 replaced it.

Expecting chalk.underlineRed('typo') to show a colored underline
Add an underline style too, e.g. chalk.underlineRed.underlineCurly('typo')

Underline colors only show together with an underline style, and many terminals ignore them.

Questions

Can I load it with require() in an older CommonJS project?

Versions 5 and 6 are loaded with import. The readme suggests staying on chalk 4 if your TypeScript or build setup cannot handle that.

How do I turn colors off for a log file?

Set FORCE_COLOR=0 when you run the program, or create new Chalk({ level: 0 }) in your code.

Does it work in the browser?

Only in the developer console, which shows the color codes in Chrome since version 69. It does not style page text.

Does it pull in other packages?

No. The readme says chalk has no dependencies.