Node: Colorise Terminal Strings with Chalk

July 17, 2018
chalk node npm javascript

Chalk is a JavaScript library for colorising the strings that you write to the terminal. It has a large number of uses from applications to debugging.

Easy to Use

const chalk = require(‘chalk’);
console.log(‘Green is the color!’));

Forecolor e.g: black, red, green, yellow, blue, magenta, cyan, white, gray, redBright, greenBright, yellowBright, blueBright, magentaBright, cyanBright, whiteBright

Backcolor e.g: bgBlack, bgRed, bgGreen, bgYellow,bgBlue, bgMagenta, bgCyan, bgWhite, bgBlackBright, bgRedBright, bgGreenBright, bgYellowBright, bgBlueBright, bgMagentaBright, bgCyanBright, bgWhiteBright

Modifiers e.g: bold, dim, underline, inverse

Chainable:‘some text’);

Define simple themes:

const chalk = require(‘chalk’);
const error =;
const warning = chalk.keyword(‘orange’);
templates like {cyan.bold ${func(x)} sometext}

256 and Truecolor support.

License: Chalk is licensed under MIT.
Popularity: Huge. Chalk has about 13+ million downloads per week and used in over 23,000 packages.

chalk example

Where to Find Chalk

On npm:

On github:

Recommended Installation:
npm install chalk