Command Line Colors, like chalk, based on yoctocolors
npm install @znode/colors@zodash/colors> The smallest and fastest command-line coloring package on the internet. Trust me.
The only thing that matters is micro-benchmark performance! ⚡️
_Check out Chalk if you want something more mature and comprehensive._
- 4x faster and 5x smaller than nanocolors
- Cat friendly
- An additional color
- Tree-shakeable, not stirred
- Actively maintained (at least for another week)
- No dependencies
``sh`
npm install yoctocolors
`
import * as colors from '@znode/colors';
console.log(colors.red('Yo!'));
`
_This package supports basic color detection. Colors can be forcefully enabled by setting the FORCE_COLOR environment variable to 1 and can be forcefully disabled by setting NO_COLOR or NODE_DISABLE_COLORS to any value. More info._
- reset - Reset the current style.bold
- - Make the text bold.dim
- - Make the text have lower opacity.italic
- - Make the text italic. _(Not widely supported)_underline
- - Put a horizontal line above the text. _(Not widely supported)_overline
- - Put a horizontal line below the text. _(Not widely supported)_inverse
- - Invert background and foreground colors.hidden
- - Print the text but make it invisible.strikethrough
- - Put a horizontal line through the center of the text. _(Not widely supported)_
- blackred
- green
- yellow
- blue
- magenta
- cyan
- white
- gray
-
- bgBlackbgRed
- bgGreen
- bgYellow
- bgBlue
- bgMagenta
- bgCyan
- bgWhite
- bgGray
-
Yes
``
❯ ./test/simple-benchmark.js
nanocolors 31508276 ops/sec
picocolors 32524769 ops/sec
yoctocolors 132894792 ops/sec
_Benchmark from nanocolors`_
It's the smallest official unit prefix in the metric system. Much smaller than nano.
- yoctocolors - The smallest and fastest command-line coloring package on the internet
- yoctodelay - Delay a promise a given amount of time
- chalk - Terminal string styling