Skip to content

A tiny library providing the basic ANSI colors for the terminal.

License

Notifications You must be signed in to change notification settings

fabiospampinato/tiny-colors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tiny Colors

A tiny library providing the basic ANSI colors for the terminal.

Install

npm install tiny-colors

Colors

The following color functions are provided.

Foreground Background Modifiers
black bgBlack reset
red bgRed bold
green bgGreen dim
yellow bgYellow italic
blue bgBlue underline
magenta bgMagenta overline
cyan bgCyan inverse
white bgWhite hidden
gray bgGray strikethrough

Usage

import colors, {ENABLED} from 'tiny-colors';

// Unchained usage

console.log ( colors.bgMagenta ( colors.italic ( 'foo' ) ) );

// Chained usage

console.log ( colors.bgMagenta.italic ( 'foo' ) );

// Check if colors will actually be displayed

console.log ( ENABLED ); // => true/false

License

MIT © Fabio Spampinato

About

A tiny library providing the basic ANSI colors for the terminal.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published