Skip to main content

What is Tiny Terminal Colors?

· One min read
Abhay Raj Patel
Frontend Developer

Tiny Terminal Colors logo

Tiny Terminal Colors is a lightweight, zero-dependency Node.js package that helps you style terminal output using ANSI escape codes.

How to Use Tiny Terminal Colors Package?

Import the library:

const color = require('tiny-terminal-colors');

Basic Usage

console.log(color.red('Red Text'));
console.log(color.bgYellow('Yellow Background'));
console.log(color.bold(color.underline('Bold Underlined Text')));

Nesting

console.log(color.green(color.bgBlack('Green on Black')));

Colorful Status Logs

console.log(color.yellow('[WARNING] Disk almost full'));
console.log(color.bgRed(color.white('[ERROR] Service failed')));