đź–Ť Terminal string styling done right
Chalk now comes with TypeScript type definitions built-in. https://github.com/chalk/chalk/commit/f653b061d6fbdb1c7224f7d80476391202c47877
Note: It's incompatible with @types/chalk
if you're currently using that: https://github.com/chalk/chalk/issues/215
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.
chalk.hasColor()
. Use the has-ansi
package directly instead. https://github.com/chalk/chalk/commit/04cae226cc0fc11fd7898f3fa91fdc4a3b3e496b
chalk.stripColor()
. Use the strip-ansi
package directly instead. https://github.com/chalk/chalk/commit/04cae226cc0fc11fd7898f3fa91fdc4a3b3e496b
chalk.styles
. Use the ansi-styles
package directly instead. https://github.com/chalk/chalk/commit/870249689acc6b04e81e96d2c09c39b76c640a94
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.
https://github.com/chalk/chalk/commit/cb3f2308e17cd2878d2722db7762bdc725e9ff48
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}}`);
https://github.com/chalk/chalk/commit/f66271e01a901470a3d5afcb3feae552848ccf0c
https://github.com/chalk/chalk/compare/v1.1.3...v2.0.0
Made with ♥ by Josh, Sindre, and all our wonderful contributors.
Fixes a very strange issue with using the same name for a variable and its assigned function. https://github.com/chalk/chalk/issues/81
Probably a V8 bug.
Chalk is now used by over 4000 npm packages and has become the eight most depended on package in the world!
$ npm install --save chalk
gray.dim
is a noop on Windows to work around cmd.exe bugs. #58https://github.com/chalk/chalk/compare/v1.0.0...v1.1.0
Help us get npm packages upgraded to chalk 1.1.0 by submitting a Pull Request to any of these repositories upgrading their chalk
dependency in package.json
.
We're also looking for feedback on the documentation. If you think anything can be improved, let us know by opening an issue ;)
Made with ♥ by Sindre, Joshua, JD, and all our wonderful contributors.
Introducing chalk 1.0.0!
Chalk is a node module for styling/colorizing terminal output.
Chalk is now used by ~3000 npm packages and even displayed on the npm landing page.
Fun fact: Technically, color doesn’t exist. Color is created only when our brain tries to make sense from light signals it receives from the outer world. In other words, it’s all in your head.
$ npm install --save chalk
FORCE_COLOR
environment variable. 19935d6484811c5e468817f846b7b3d417d7bf4aUpstart
. https://github.com/sindresorhus/supports-color/commit/3371f56ec42b389014ced49970b037777e27571e
https://github.com/sindresorhus/chalk/compare/v0.5.1...v1.0.0
Help us get npm packages upgraded to chalk 1.0.0 by submitting a Pull Request to any of these repositories upgrading their chalk
dependency in package.json
.
We're also looking for feedback on the documentation. If you think anything can be improved, let us know by opening an issue ;)
Made with ♥ by Sindre, Joshua, and all our wonderful contributors.
.hasColor()
method for checking if a string contains color escape codes.dim
and hidden
styles.