tiny-colors

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

MIT 11 个版本
安装
npm install tiny-colors
yarn add tiny-colors
pnpm add tiny-colors
bun add tiny-colors
README

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.

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

版本列表
2.2.2 2025-01-12
2.2.1 2024-06-10
2.2.0 2024-05-25
2.1.3 2024-04-04
2.1.2 2023-08-25
2.1.1 2023-08-25
2.1.0 2023-08-12
2.0.2 2023-02-11
2.0.1 2022-04-05
2.0.0 2022-04-04
1.0.0 2022-04-03