Need help with chalk?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

16.8K Stars 655 Forks MIT License 319 Commits 2 Opened issues


🖍 Terminal string styling done right

Services available


Need anything else?

Contributors list


Terminal string styling done right

Coverage Status npm dependents Downloads run on Support Chalk on DEV



$ npm install chalk


import chalk from 'chalk';

console.log('Hello world!'));

Chalk comes with an easy to use composable API where you just chain and nest the styles you want.

import chalk from 'chalk';

const log = console.log;

// Combine styled and normal strings log('Hello') + ' World' +'!'));

// Compose multiple styles using the chainable API log('Hello world!'));

// Pass in multiple arguments log('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz'));

// Nest styles log('Hello', chalk.underline.bgBlue('world') + '!'));

// Nest styles of the same type even (color, underline, background) log( 'I am a green line ' +'with a blue substring') + ' that becomes green again!' ));

// ES2015 template literal log(CPU: ${'90%')} RAM: ${'40%')} DISK: ${chalk.yellow('70%')});

// ES2015 tagged template literal log(chalkCPU: {red ${cpu.totalPercent}%} RAM: {green ${ram.used / * 100}%} DISK: {rgb(255,131,0) ${disk.used / * 100}%});

// Use RGB colors in terminal emulators that support it. log(chalk.rgb(123, 45, 67).underline('Underlined reddish color')); log(chalk.hex('#DEADED').bold('Bold gray!'));

Easily define your own themes:

import chalk from 'chalk';

const error =; const warning = chalk.hex('#FFA500'); // Orange color

console.log(error('Error!')); console.log(warning('Warning!'));

Take advantage of console.log string substitution:

import chalk from 'chalk';

const name = 'Sindre'; console.log('Hello %s'), name); //=> 'Hello Sindre'



We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.