Gathering detailed insights and metrics for ansis
As of June 2024, the npm registry hosts over 2 million packages, making it one of the largest open-source software repositories in the world.
Gathering detailed insights and metrics for ansis
As of June 2024, the npm registry hosts over 2 million packages, making it one of the largest open-source software repositories in the world.
npm install ansis
99.4
Supply Chain
62
Quality
83.4
Maintenance
100
Vulnerability
100
License
231 Stars
68 Commits
9 Forks
2 Watching
1 Branches
6 Contributors
Updated on 19 Nov 2024
Minified
Minified + Gzipped
JavaScript (98.97%)
TypeScript (1.03%)
Cumulative downloads
Total Downloads
Last day
5.3%
125,278
Compared to previous day
Last week
8%
671,740
Compared to previous week
Last month
20.9%
2,782,419
Compared to previous month
Last year
280.8%
15,570,249
Compared to previous year
No dependencies detected.
Colorize terminal with ANSI colors & styles, smaller and faster alternative to Chalk with additional useful features.
1import ansis, { red, green, cyan, black, ansi256, hex } from 'ansis'; 2 3ansis.blueBright('file.txt') 4green`Succeful!` 5red`Error: ${cyan(file)} not found!` 6black.bgYellow`Warning!` 7ansi256(214)`Orange` 8hex('#E0115F').bold.underline('TrueColor!')
Most popular ANSI libraries for Node.js:
chalk, kleur, ansi-colors, kolorist, colorette, picocolors, cli-color, colors-cli, colors.js
1- import chalk from 'chalk'; 2+ import chalk, { red } from 'ansis';
1chalk.red.bold('Error!'); // <- Chalk like syntax works fine with Ansis 2red.bold('Error!'); // <- the same result with Ansis 3red.bold`Error!`; // <- the same result with Ansis
import ansis, { red, bold, ansi256, hex } from 'ansis'
red.bold.underline('text')
red`RED ${green`GREEN`} RED`
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 `foo ${red.open}red{red.close} bar`
ansis.strip()
ansis.isSupported()
methodNO_COLOR
FORCE_COLOR
and flags --no-color
--color
end of line
when used \n
in stringString.prototype
⚠️ Warning
The
v3
has the BREAKING CHANGES (removed not widely supported styles and DEPRECATIONS).
For details see the changelog.
If you have discovered a bug or have a feature suggestion, feel free to create an issue on GitHub.
1npm install ansis
You can import default module or named colors with ESM or CommonJS syntax.
1// ESM default import 2import ansis from 'ansis'; 3// ESM named import 4import { red, green, blue } from 'ansis';
or
1// CommonJS default import 2const ansis = require('ansis'); 3// CommonJS named import 4const { red, green, blue } = require('ansis');
See the list of the ANSI colors and styles.
1console.log(ansis.green('Success!')); 2console.log(green('Success!')); 3 4// template string 5console.log(green`Success!`); 6 7// chained syntax 8console.log(green.bold`Success!`); 9 10// nested syntax 11console.log(red`The ${blue.underline`file.js`} not found!`); 12
Basic example Hello World!
:
1import { red, black, inverse, reset } from 'ansis'; 2 3console.log(green`Hello ${inverse`ANSI`} World! 4${black.bgYellow`Warning:`} ${cyan`/path/to/file.js`} ${red`not found!`}`);
Output:
The ansis
supports both the default import
and named import
.
1// default import 2import ansis from 'ansis'; 3 4ansis.red.bold('text');
You can import named colors, styles and functions. All imported colors and styles are chainable
.
1// named import 2import { red, hex, italic } from 'ansis'; 3 4red.bold('text');
Default import and named import can be combined.
1// default and named import 2import ansis, { red } from 'ansis'; 3 4const redText = red('text'); // colorized ANSI string 5const text = ansis.strip(redText); // pure string without ANSI codes
The ansis
supports both the function syntax red('error')
and template literals red`error`
.
The template literals
allow you to make a complex template more readable and shorter.
The function syntax
can be used to colorize a variable.
1import { red } from 'ansis'; 2 3let message = 'error'; 4 5red(message); 6red`text`; 7red`text ${message} text`;
All colors, styles and functions are chainable. Each color or style can be combined in any order.
1import { red, bold, italic, hex } from 'ansis'; 2 3red.bold`text`; 4hex('#FF75D1').bgCyan.bold`text`; 5bold.bgHex('#FF75D1').cyan`text`; 6italic.bold.yellow.bgMagentaBright`text`;
You can nest functions and template strings within each other. None of the other libraries (chalk, kleur, colorette, colors.js etc.) support nested template strings.
Nested template strings:
1import { red, green } from 'ansis'; 2 3red`red ${green`green`} red`;
Deep nested chained styles:
1import { red, green, cyan, magenta, yellow, italic, underline } from 'ansis'; 2 3red(`red ${italic(`red italic ${underline(`red italic underline`)}`)} red`); 4 5// deep nested chained styles 6green( 7 `green ${yellow( 8 `yellow ${magenta( 9 `magenta ${cyan( 10 `cyan ${red.italic.underline`red italic underline`} cyan`, 11 )} magenta`, 12 )} yellow`, 13 )} green`, 14);
Output:
Multiline nested template strings:
1import { red, green, hex, visible, inverse } from 'ansis'; 2 3// defined a TrueColor as the constant 4const orange = hex('#FFAB40'); 5 6let cpu = 33; 7let ram = 44; 8let disk = 55; 9 10// normal colors 11visible` 12CPU: ${red`${cpu}%`} 13RAM: ${green`${ram}%`} 14DISK: ${orange`${disk}%`} 15`; 16 17// inversed colors 18inverse` 19CPU: ${red`${cpu}%`} 20RAM: ${green`${ram}%`} 21DISK: ${orange`${disk}%`} 22`;
Output:
Colors and styles have standard names used by many popular libraries, such as chalk, colorette, kleur.
Foreground colors | Background colors | Styles |
---|---|---|
black | bgBlack | dim |
red | bgRed | bold |
green | bgGreen | italic |
yellow | bgYellow | underline |
blue | bgBlue | strikethrough strike ) |
magenta | bgMagenta | inverse |
cyan | bgCyan | visible |
white | bgWhite | hidden |
blackBright aliases: grey gray US spelling | bgBlackBright aliases: bgGrey bgGray US spelling | reset |
redBright | bgRedBright | |
greenBright | bgGreenBright | |
yellowBright | bgYellowBright | |
blueBright | bgBlueBright | |
magentaBright | bgMagentaBright | |
cyanBright | bgCyanBright | |
whiteBright | bgWhiteBright |
Defaults, the imported ansis
instance contains base styles and colors.
To extend base colors with custom color names for TrueColor use the ansis.extend()
method.
1import ansis from 'ansis'; 2 3// extend base colors 4ansis.extend({ 5 pink: '#FF75D1', 6 orange: '#FFAB40', 7}); 8 9// the custom colors are available under namespace `ansis` 10ansis.pink('text'); 11ansis.orange('text');
Usage example with TypeScript:
1import ansis, { AnsiColorsExtend } from 'ansis'; 2 3// extend base colors 4ansis.extend({ 5 pink: '#FF75D1', 6 orange: '#FFAB40', 7}); 8 9const write = (style: AnsiColorsExtend<'pink' | 'orange'>, message: string) => { 10 console.log(ansis[style](message)); 11} 12 13write('red', 'message'); // base color OK 14write('pink', 'message'); // extended color OK 15write('orange', 'message'); // extended color OK 16write('unknown', 'message'); // TypeScript Error
The pre-defined set of 256 colors.
Code range | Description |
---|---|
0 - 7 | standard colors |
8 - 15 | bright colors |
16 - 231 | 6 × 6 × 6 cube (216 colors) |
232 - 255 | grayscale from black to white in 24 steps |
Foreground function: ansi256(code)
has short alias fg(code)
Background function: bgAnsi256(code)
has short alias bg(code)
The
ansi256()
andbgAnsi256()
methods are implemented for compatibility with thechalk
API.
See ANSI color codes.
If a terminal supports only 16 colors then ANSI 256 colors will be interpolated into base 16 colors.
1import { bold, ansi256, fg, bgAnsi256, bg } from 'ansis'; 2 3// foreground color 4ansi256(96)`Bright Cyan`; 5fg(96)`Bright Cyan`; // alias for ansi256 6 7// background color 8bgAnsi256(105)`Bright Magenta`; 9bg(105)`Bright Magenta`; // alias for bgAnsi256 10 11// function is chainable 12ansi256(96).bold`bold Bright Cyan`; 13 14// function is avaliable in each style 15bold.ansi256(96).underline`bold underline Bright Cyan`; 16 17// you can combine the functions and styles in any order 18bgAnsi256(105).ansi256(96)`cyan text on magenta background` 19bg(105).fg(96)`cyan text on magenta background`
You can use the hex
or rgb
format.
Foreground function: hex()
rgb()
Background function: bgHex()
bgRgb()
1import { bold, hex, rgb, bgHex, bgRgb } from 'ansis'; 2 3// foreground color 4hex('#E0115F').bold`bold Ruby`; 5hex('#96C')`Amethyst`; 6rgb(224, 17, 95).italic`italic Ruby`; 7 8// background color 9bgHex('#E0115F')`Ruby`; 10bgHex('#96C')`Amethyst`; 11bgRgb(224, 17, 95)`Ruby`; 12 13// you can combine the functions and styles in any order 14bold.hex('#E0115F').bgHex('#96C')`ruby bold text on amethyst background`
The ansis
supports fallback to supported color space.
TrueColor —> 256 colors —> 16 colors —> no colors (black & white)
If you use the hex()
, rgb()
or ansis256()
functions in a terminal not supported TrueColor or 256 colors, then colors will be interpolated.
You can use the ANSI escape codes with open
and close
properties for each style.
1import { red, bold } from 'ansis'; 2 3// each style has `open` and `close` properties 4console.log(`Hello ${red.open}ANSI${red.close} World!`); 5 6// you can defiene own style which will have the `open` and `close` properties 7const myStyle = bold.italic.black.bgHex('#E0115F'); 8 9console.log(`Hello ${myStyle.open}ANSI${myStyle.close} World!`);
The Ansis class contains the method strip()
to remove all ANSI codes from string.
1import ansis from 'ansis'; 2 3const ansiString = ansis.green`Hello World!`; 4const string = ansis.strip(ansiString);
The variable string
will contain the pure string without ANSI codes.
Supports correct style break at the end of line
.
1import { bgGreen } from 'ansis'; 2 3console.log(bgGreen`\nAnsis\nNew Line\nNext New Line\n`);
Define your own themes:
1import ansis from 'ansis'; 2 3const theme = { 4 info: ansis.cyan.italic, 5 warn: ansis.black.bgYellowBright, 6 error: ansis.red.bold, 7 ruby: ansis.hex('#E0115F'), 8}; 9 10theme.info('info'); 11theme.warn('warning'); 12theme.error('error'); 13theme.ruby('Ruby color');
Defaults, the output in terminal console is colored and output in a file is uncolored.
To force disable or enable colored output use environment variables NO_COLOR
and FORCE_COLOR
.
The NO_COLOR
variable should be presents with any not empty value.
The value is not important, e.g., NO_COLOR=1
NO_COLOR=true
disable colors.
See standard description by NO_COLOR.
The FORCE_COLOR
variable should be presents with one of values:
FORCE_COLOR=0
force disable colors
FORCE_COLOR=1
force enable colors
See standard description by FORCE_COLOR.
For example, app.js:
1import { red } from 'ansis'; 2 3console.log(red`red color`);
Execute the script in a terminal:
$ node app.js # colored output in terminal
$ node app.js > log.txt # output in file without ANSI codes
$ NO_COLOR=1 node app.js # force disable colors, non colored output in terminal
$ FORCE_COLOR=0 node app.js # force disable colors, non colored output in terminal
$ FORCE_COLOR=1 node app.js > log.txt # force enable colors, output in file with ANSI codes
If your environment supports 256 colors, but ansis
detects only 16 or mono,
you can manually set the TERM
variable with standard values: screen-256color
or xterm-256color
.
You can set the variable in CLI:
TERM=screen-256color node script.js
or directly in your script:
1process.env.TERM = 'screen-256color';
If your environment supports truecolor, but ansis
detects only 256, 16 or mono,
you can manually set the COLORTERM
variable with standard values: truecolor
or 24bit
.
You can set the variable in CLI:
COLORTERM=truecolor node script.js
or directly in your script:
1process.env.COLORTERM = 'truecolor';
Use arguments --no-color
or --color=false
to disable colors and --color
to enable ones.
For example, an executable script app.js:
1#!/usr/bin/env node 2import { red } from 'ansis'; 3 4console.log(red`red color`);
Execute the script in a terminal:
$ ./app.js # colored output in terminal
$ ./app.js --no-color # non colored output in terminal
$ ./app.js --color=false # non colored output in terminal
$ ./app.js > log.txt # output in file without ANSI codes
$ ./app.js --color > log.txt # output in file with ANSI codes
$ ./app.js --color=true > log.txt # output in file with ANSI codes
Warning
The command line arguments have a higher priority than environment variable.
Ansis automatically detects the supported color space:
Ansis has the method isSupported()
that returns a boolean
value whether the output supports ANSI color and styles.
1import ansis from 'ansis'; 2 3console.log('Color output: ', ansis.isSupported());
There is no standard way to detect which color space is supported.
The most common way to detect color support is to check the TERM
and COLORTERM
environment variables.
CI systems can be detected by checking for the existence of the CI
and other specifically environment variables.
Combine that with the knowledge about which operating system the program is running on, and we have a decent enough way to detect colors.
Terminal | ANSI 16 colors | ANSI 256 colors | True Color | env. TERM | env. COLORTERM | Specifically ENV variables |
---|---|---|---|---|---|---|
Azure CI | ✅ | ❌ | ❌ | dumb | TF_BUILD AGENT_NAME | |
GitHub CI | ✅ | ✅ | ✅ | dumb | CI GITHUB_ACTIONS | |
GitTea CI | ✅ | ✅ | ✅ | dumb | CI GITEA_ACTIONS | |
GitLab CI | ✅ | ❌ | ❌ | dumb | CI GITLAB_CI | |
Travis CI | ✅ | ❌ | ❌ | dumb | TRAVIS | |
PM2 not isTTY | ✅1 | ✅1 | ✅1 | dumb | PM2_HOME pm_id | |
JetBrains TeamCity >=2020.1.1 | ✅ | ✅ | ❌ | TEAMCITY_VERSION | ||
JetBrains IDEA | ✅ | ✅ | ✅ | xterm-256color | TERMINAL_EMULATOR='JetBrains-JediTerm' | |
VS Code | ✅ | ✅ | ✅ | xterm-256color | truecolor | |
Windows Terminal | ✅ | ✅ | ✅2 | |||
Windows PowerShell | ✅ | ✅ | ✅2 | |||
macOS Terminal | ✅ | ✅ | ❌ | xterm-256color | ||
iTerm | ✅ | ✅ | ✅ | xterm-256color | truecolor | |
Terminal emulator Kitty | ✅ | ✅ | ✅ | xterm-kitty |
See also:
Run the command to see the support of some features by various libraries:
npm run compare
Library - named import - naming colors | ANSI 16 colors | ANSI 256 colors | True Color | Chained syntax | Nested template strings | New Line | Fallback to colors | Supports ENV vars CLI flags |
---|---|---|---|---|---|---|---|---|
ansis ✅ named import ✅ standard | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | →256 →16 →b&w | NO_COLOR FORCE_COLOR --no-color --color |
chalk ❌ named import ✅ standard | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | →256 →16 →b&w | NO_COLOR FORCE_COLOR --no-color --color |
kolorist ✅ named import ❌ standard | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | →256 →b&w | NO_COLOR FORCE_COLOR |
cli-color ❌ named import ✅ standard | ✅ | ✅ | ❌ | ✅ | ❌ | ❌ | →16 →b&w | NO_COLOR |
colors-cli ❌ named import ❌ standard | ✅ | ✅ | ❌ | ✅ | ❌ | ✅ | →b&w | --no-color --color |
colors.js ❌ named import ❌ standard | ✅ | ❌ | ❌ | ✅ | ❌ | ✅ | →b&w | FORCE_COLOR --no-color --color |
ansi-colors ❌ named import ✅ standard | ✅ | ❌ | ❌ | ✅ | ❌ | ✅ | ❌ | FORCE_COLOR |
colorette ✅ named import ✅ standard | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | →b&w | NO_COLOR FORCE_COLOR --no-color --color |
picocolors ❌ named import ✅ standard | ✅ since v1.1.0 | ❌ | ❌ | ❌ | ❌ | ❌ | →b&w | NO_COLOR FORCE_COLOR --no-color --color |
kleur ✅ named import ✅ standard | ❌8 colors | ❌ | ❌ | ✅ | ❌ | ❌ | →b&w | NO_COLOR FORCE_COLOR |
Note
Named import
ESM
import { red, green, blue } from 'lib';
CJS
const { red, green, blue } = require('lib');
Naming colors
- standard: colors have standard names, e.g.:
red
,redBright
,bgRed
,bgRedBright
- non-standard: colors have lib-specific names, e.g.:
brightRed
,bgBrightRed
,red_b
,red_btt
ANSI 256 colors
The method names:
colors-cli
:x<n>
cli-color
:xterm(n)
chalk
:ansi256(n)
bgAnsi256(n)
ansis
:ansi256(n)
bgAnsi256(n)
fg(n)
bg(n)
TrueColor
The method names:
Chained syntax
lib.red.bold('text')
Nested template strings
lib.red`text ${lib.cyan`nested`} text`
New line
Correct break styles atend-of-line
.lib.bgGreen(`First Line Next Line`);
Npm package | Require size | Install size | Download size |
---|---|---|---|
picocolors | 2.6 kB | 11.4 kB | 2.6 kB |
kleur | 2.7 kB | 20.3 kB | 6.0 kB |
ansis | 3.4 kB | 11.4 kB | 4.6 kB |
colorette | 3.4 kB | 17.0 kB | 4.9 kB |
ansi-colors | 5.8 kB | 26.1 kB | 8.5 kB |
kolorist | 6.8 kB | 51.0 kB | 8.7 kB |
colors-cli | 8.7 kB | 511.0 kB | 361.7 kB |
cli-color | 12.1 kB | 39.6 (754 kB) | 13.8 (216 kB) |
chalk | 16.4 kB | 43.7 kB | 13.1 kB |
colors.js | 18.1 kB | 39.5 kB | 11.0 kB |
Require size: The size of distributed code that will be loaded via require
or import
into your app.
Install size: The unpacked size of the npm package in the node_modules/
directory, (incl. dependencies)
.
Download size: The gzipped size of the npm package.
See also:
1git clone https://github.com/webdiscus/ansis.git 2cd ./ansis 3npm i 4npm run demo
To measure performance is used benchmark.js.
‼️ Warning
Don't trust other test results using vitest benchmark.
The
vitest benchmark
generate FALSE/unreal results.
For example, the results of the simple bench:chalk.red('foo') - 7.000.000 ops/sec ansis.red('foo') - 23.000.000 ops/sec (x3 faster is WRONG result)
The real performance results of
chalk
andansis
in this test are very close.
1git clone https://github.com/webdiscus/ansis.git 2cd ./ansis 3npm i 4npm run bench
Tested on
MacBook Pro 16" M1 Max 64GB
macOS Monterey 12.1
Node.js v16.13.1
TerminaliTerm2
The benchmark used in colorette
.
1c.red(`${c.bold(`${c.cyan(`${c.yellow('yellow')}cyan`)}`)}red`);
1+ colorette 4,572,582 ops/sec very fast 2 picocolors 3,841,124 ops/sec very fast 3-> ansis 2,725,758 ops/sec fast 4 chalk 2,287,146 ops/sec fast 5 kleur/colors 2,281,415 ops/sec fast 6 kleur 2,228,639 ops/sec fast 7 ansi-colors 1,265,615 ops/sec slow 8 colors.js 1,158,572 ops/sec slow 9 cli-color 470,320 ops/sec too slow 10 colors-cli 109,811 ops/sec too slow
1const colors = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white']; 2colors.forEach((color) => c[color]('foo'));
1+ picocolors 8,265,628 ops/sec very fast 2-> ansis 6,197,754 ops/sec fast 3 kleur 5,455,121 ops/sec fast 4 chalk 4,428,884 ops/sec fast 5 kleur/colors 2,074,111 ops/sec slow 6 colorette 1,874,506 ops/sec slow 7 ansi-colors 1,010,628 ops/sec slow 8 colors.js 640,101 ops/sec too slow 9 cli-color 305,690 ops/sec too slow 10 colors-cli 104,962 ops/sec too slow
1const colors = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white']; 2colors.forEach((color) => c[color].bold.underline.italic('foo'));
1+ ansis 5,515,868 ops/sec very fast 2 chalk 1,234,573 ops/sec fast 3 kleur 514,035 ops/sec slow 4 ansi-colors 158,921 ops/sec too slow 5 cli-color 144,837 ops/sec too slow 6 colors.js 138,219 ops/sec too slow 7 colors-cli 52,732 ops/sec too slow 8 kleur/colors (not supported) 9 colorette (not supported) 10 picocolors (not supported)
1const colors = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white']; 2colors.forEach((color) => c[color](c.bold(c.underline(c.italic('foo')))));
1+ picocolors 942,592 ops/sec very fast 2 colorette 695,350 ops/sec fast 3 kleur 648,195 ops/sec fast 4 kleur/colors 561,111 ops/sec fast 5-> ansis 558,575 ops/sec fast 6 chalk 497,292 ops/sec fast 7 ansi-colors 260,316 ops/sec slow 8 colors.js 166,425 ops/sec slow 9 cli-color 65,561 ops/sec too slow 10 colors-cli 13,800 ops/sec too slow
1c.red( 2 `a red ${c.white('white')} red ${c.red('red')} red ${c.cyan('cyan')} red ${c.black('black')} red ${c.red('red')} red 3 ${c.red('red')} red ${c.red('red')} red ${c.red('red')} red ${c.red('red')} red ${c.red('red')} red ${c.red('red')} red 4 ${c.green('green')} red ${c.red('red')} red ${c.yellow('yellow')} red ${c.blue('blue')} red ${c.red('red')} red 5 ${c.magenta('magenta')} red ${c.red('red')} red ${c.red('red')} red ${c.red('red')} red ${c.red('red')} red 6 ${c.red('red')} red ${c.red('red')} red ${c.red('red')} red ${c.red('red')} red ${c.red('red')} red 7 ${c.black('black')} red ${c.yellow('yellow')} red ${c.red('red')} red ${c.red('red')} red ${c.red('red')} red 8 ${c.yellow('yellow')} red ${c.red('red')} red ${c.red('red')} red ${c.red('red')} red ${c.red('red')} red 9 ${c.green('green')} red ${c.red('red')} red ${c.red('red')} red ${c.red('red')} red ${c.red('red')} red 10 ${c.magenta('magenta')} red ${c.red('red')} red ${c.red('red')} red ${c.cyan('cyan')} red ${c.red('red')} red 11 ${c.cyan('cyan')} red ${c.red('red')} red ${c.red('red')} red ${c.red('red')} red ${c.red('red')} red message` 12);
1+ picocolors 243,975 ops/sec very fast 2 colorette 243,139 ops/sec very fast 3 kleur/colors 234,132 ops/sec very fast 4 kleur 221,446 ops/sec very fast 5-> ansis 211,868 ops/sec very fast 6 chalk 189,960 ops/sec fast 7 ansi-colors 121,451 ops/sec slow 8 colors.js 89,633 ops/sec too slow 9 cli-color 41,657 ops/sec too slow 10 colors-cli 14,264 ops/sec too slow
1c.green( 2 `green ${c.cyan( 3 `cyan ${c.red( 4 `red ${c.yellow( 5 `yellow ${c.blue( 6 `blue ${c.magenta(`magenta ${c.underline(`underline ${c.italic(`italic`)} underline`)} magenta`)} blue` 7 )} yellow` 8 )} red` 9 )} cyan` 10 )} green` 11);
1+ colorette 1,131,757 ops/sec very fast 2 picocolors 1,002,649 ops/sec very fast 3-> ansis 882,220 ops/sec very fast 4 chalk 565,965 ops/sec fast 5 kleur/colors 478,547 ops/sec fast 6 kleur 464,004 ops/sec fast 7 colors.js 451,592 ops/sec fast 8 ansi-colors 362,733 ops/sec slow 9 cli-color 213,441 ops/sec slow 10 colors-cli 40,340 ops/sec too slow
Only two libraries support TrueColor: ansis
and chalk
1c.hex('#FBA')('foo');
1+ ansis 4,944,572 ops/sec very fast 2 chalk 2,891,684 ops/sec fast 3 colors.js (not supported) 4 colorette (not supported) 5 picocolors (not supported) 6 cli-color (not supported) 7 colors-cli (not supported) 8 ansi-colors (not supported) 9 kleur/colors (not supported) 10 kleur (not supported)
npm run test
will run the unit and integration tests.
npm run test:coverage
will run the tests with coverage.
No vulnerabilities found.
No security vulnerabilities found.
@bluepineapple-nebbia-tech/query-tool
Introducing "query_tool" - a powerful and user-friendly npm package designed to simplify your data analysis. With its intuitive interface, you can easily select the desired databases, columns, and tables, and apply filters, dimensions, and measures to ana
ansistyles
Functions that surround a string with ansistyle codes so it prints in style.
ansis-theme
Package test
ansispan
Change your ANSI color codes into HTML `<span>`s