
Product
Secure Your AI-Generated Code with Socket MCP
Socket MCP brings real-time security checks to AI-generated code, helping developers catch risky dependencies before they enter the codebase.
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 6,830,162 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.
Product
Socket MCP brings real-time security checks to AI-generated code, helping developers catch risky dependencies before they enter the codebase.
Security News
As vulnerability data bottlenecks grow, the federal government is formally investigating NISTβs handling of the National Vulnerability Database.
Research
Security News
Socketβs Threat Research Team has uncovered 60 npm packages using post-install scripts to silently exfiltrate hostnames, IP addresses, DNS servers, and user directories to a Discord-controlled endpoint.