2.2.1 • Published 1 year ago

tiny-colors v2.2.1

Weekly downloads
-
License
-
Repository
github
Last release
1 year ago

Tiny Colors

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

Install

npm install --save tiny-colors

Colors

The following color functions are provided.

ForegroundBackgroundModifiers
blackbgBlackreset
redbgRedbold
greenbgGreendim
yellowbgYellowitalic
bluebgBlueunderline
magentabgMagentaoverline
cyanbgCyaninverse
whitebgWhitehidden
graybgGraystrikethrough

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