pintor 🎨

A lightweight, zero-dependency library for adding colors to the terminal output. Useful for CLI applications, logging, and development tools.
Features
- Zero Dependencies: Lightweight and fast
- Rich Color Support: 16 colors (8 standard + 8 bright)
- Background Colors: All colors available as background colors
- Text Styles: Bold, italic, underline, and more
- Auto-Detection: Automatically detects color support
Installation
npm install pintor
Usage
import colors from 'pintor'
// Text colors
console.log(colors.red('This is red text'))
console.log(colors.green('This is green text'))
console.log(colors.blue('This is blue text'))
// Bright colors
console.log(colors.brightRed('This is bright red text'))
console.log(colors.brightGreen('This is bright green text'))
// Background colors
console.log(colors.bgRed('This has a red background'))
console.log(colors.bgBlue('This has a blue background'))
// Text styles
console.log(colors.bold('This is bold text'))
console.log(colors.italic('This is italic text'))
console.log(colors.underline('This is underlined text'))
Available Colors
Category | Available Styles |
---|---|
Foreground Colors | black , red , green , yellow , blue , magenta , cyan , white , gray /grey |
Bright Foreground Colors | brightBlack , brightRed , brightGreen , brightYellow , brightBlue , brightMagenta , brightCyan , brightWhite |
Background Colors | bgBlack , bgRed , bgGreen , bgYellow , bgBlue , bgMagenta , bgCyan , bgWhite , bgGray /bgGrey |
Bright Background Colors | bgBrightBlack , bgBrightRed , bgBrightGreen , bgBrightYellow , bgBrightBlue , bgBrightMagenta , bgBrightCyan , bgBrightWhite |
Text Styles | bold , dim , italic , underline , overline , inverse , hidden , strikethrough |
License
MIT (c) Cezar Augusto