ANSI color styling for text in terminal.
$ npm install ansis
Colorize terminal with ANSI colors & styles, smaller and faster alternative to Chalk.
import ansis, { red, green, black, ansi256, hex } from 'ansis';
ansis.cyan('path/to/file')
green('Succeful!')
red`Error!`
black.bgYellow`Warning!`
ansi256(214)`Orange`
hex('#E0115F').bold.underline('Hello TrueColor!')
🚀 Install and Quick Start
📖 Read full docs on GitHub
See the features comparison and benchmarks of most popular terminal colors libraries:
ansis
chalk
kleur
kolorist
colors.js
colorette
picocolors
ansi-colors
cli-color
colors-cli
.
import ansis, { red, green, bold, underline } from 'ansis'
red.bold.underline('text')
red`RED text ${green`GREEN text`} RED text`
dim
bold
italic
underline
strikethrough
red`Error!`
redBright`Error!`
bgRed`Error!`
bgRedBright`Error!`
fg(56)`violet`
bg(208)`orange`
rgb(224, 17, 95)`Ruby`
, hex('#96C')`Amethyst`
open
and close
properties `Hello ${red.open}World${red.close}!`
ansis.strip()
end of line
when used \n
in stringansis.isSupported()
methodNO_COLOR
FORCE_COLOR
--no-color
--color
String.prototype
© 2010 - cnpmjs.org x YWFE | Home | YWFE