package
A tiny library providing the basic ANSI colors for the terminal.
npm install tiny-colorsGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 1 packages.
6.2 kB
Includes dependencies.
A tiny library providing the basic ANSI colors for the terminal.
npm install --save tiny-colorsThe 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 |
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/falseMIT © Fabio Spampinato