Skip to content

2.0.0

Compare
Choose a tag to compare
@sindresorhus sindresorhus released this 29 Jun 23:52
· 174 commits to main since this release

version 2

Chalk is a Node.js module for styling and colorizing terminal output.

Two years ago, @Qix- asked me about adding 256/Truecolor support to Chalk. He soon after joined the Chalk team. And now we’re finally able to ship Truecolor support in Chalk!

Chalk has had an immense growth since the 1.0.0 release in 2015. It's now trusted by more than 17.000 packages, up from 3000, and it's the 5th most depended upon package on npm.

Highlights

Breaking changes

  • Requires Node.js 4 or later.
  • Removed chalk.hasColor(). Use the has-ansi package directly instead. 04cae22
  • Removed chalk.stripColor(). Use the strip-ansi package directly instead. 04cae22
  • Removed chalk.styles. Use the ansi-styles package directly instead. 8702496

256/Truecolor support

chalk rainbow

Chalk now supports 256 colors and Truecolor (16 million colors). Terminal apps like Hyper and iTerm supports Truecolor, enabling you to create really immersive CLI experiences. Chalk is smart enough to downsample the colors to whatever the terminal supports, so you can use any colors without having to think whether it's supported or not.

Read more in the docs.

cb3f230

Tagged template literal

Chalk now ships with a tagged template literal that makes it much nicer to create long strings with lots of different styling.

const name = 'Sindre';
console.log(chalk`{bold Hello ${name}}`);

Read more in the docs.

f66271e

Other

All changes

v1.1.3...v2.0.0


Made with ♥ by Josh, Sindre, and all our wonderful contributors.