
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
yoctocolors-cjs
Advanced tools
CommonJS version - The smallest and fastest command-line coloring package on the internet
yoctocolors š
The smallest and fastest command-line coloring package on the internet
Check out Chalk if you want something more mature and comprehensive.
npm install yoctocolors
import colors from 'yoctocolors';
console.log(colors.red('Yo!'));
console.log(colors.blue(`Welcome to the ${colors.green('yoctocolors')} package!`));
You can also import colors as named imports:
import {red, blue, green} from 'yoctocolors';
console.log(red('Yo!'));
console.log(blue(`Welcome to the ${green('yoctocolors')} package!`));
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)black
red
green
yellow
blue
magenta
cyan
white
gray
redBright
greenBright
yellowBright
blueBright
magentaBright
cyanBright
whiteBright
bgBlack
bgRed
bgGreen
bgYellow
bgBlue
bgMagenta
bgCyan
bgWhite
bgGray
bgRedBright
bgGreenBright
bgYellowBright
bgBlueBright
bgMagentaBright
bgCyanBright
bgWhiteBright
Yes
$ ./benchmark.js
āāāāāāāāāāā¬āāāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāā
ā (index) ā library ā ops/sec ā
āāāāāāāāāāā¼āāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāā¤
ā 0 ā 'yoctocolors' ā '8,000,000' ā
ā 1 ā 'colorette' ā '8,000,000' ā
ā 2 ā 'picocolors' ā '8,000,000' ā
ā 3 ā 'nanocolors' ā '5,988,024' ā
ā 4 ā 'chalk' ā '4,807,692' ā
ā 5 ā 'kleur/colors' ā '4,807,692' ā
ā 6 ā 'kleur' ā '4,784,689' ā
ā 7 ā 'ansi-colors' ā '2,178,649' ā
ā 8 ā 'cli-color' ā '585,138' ā
āāāāāāāāāāā“āāāāāāāāāāāāāāāāā“āāāāāāāāāāāāāā
See benchmark.js.
It was the smallest official unit prefix in the metric system until 2022. Much smaller than nano.
FAQs
CommonJS version - The smallest and fastest command-line coloring package on the internet
The npm package yoctocolors-cjs receives a total of 8,491,218 weekly downloads. As such, yoctocolors-cjs popularity was classified as popular.
We found that yoctocolors-cjs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Ā It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.