{"name":"yoctocolors","version":"2.1.2","keywords":["color","colour","colors","terminal","console","cli","string","ansi","style","styles","tty","formatting","shell","xterm","log","logging","command-line","text"],"author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"yoctocolors@2.1.2","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/yoctocolors#readme","bugs":{"url":"https://github.com/sindresorhus/yoctocolors/issues"},"ava":{"environmentVariables":{"FORCE_COLOR":"1"}},"dist":{"shasum":"d795f54d173494e7d8db93150cec0ed7f678c83a","tarball":"http://registry-npm.ywwl.com/yoctocolors/download/yoctocolors-2.1.2.tgz","fileCount":7,"integrity":"sha512-CzhO+pFNo8ajLM2d2IW/R93ipy99LWjtwblvC1RsoSUMZgyLbYFr221TnSNT7GjGdYui6P459mw9JH/g/zW2ug==","signatures":[{"sig":"MEYCIQD1/2eHytEN8zr1h8OFf89KzZJXj5rtK0ksu752rNbV+QIhAO+sFQ/YRmufnja0mkXLHIfRci6OCzxcQpgt/KF36imb","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10509,"size":3982,"noattachment":false,"key":"/yoctocolors/-/yoctocolors-2.1.2.tgz"},"type":"module","types":"./index.d.ts","engines":{"node":">=18"},"exports":{"types":"./index.d.ts","default":"./index.js"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"ab9da8d65ff69b6dc107cfc048e3769d3a450de4","scripts":{"test":"xo && ava && tsd"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/yoctocolors.git","type":"git"},"_npmVersion":"10.9.2","description":"The smallest and fastest command-line coloring package on the internet","directories":{},"sideEffects":false,"_nodeVersion":"20.19.1","_hasShrinkwrap":false,"devDependencies":{"xo":"^0.58.0","ava":"^6.1.3","tsd":"^0.31.0","chalk":"^5.3.0","kleur":"^4.1.5","cli-color":"^2.0.4","colorette":"^2.0.20","nanocolors":"^0.2.13","picocolors":"^1.0.1","ansi-colors":"^4.1.3","@jonahsnider/benchmark":"^5.0.3"},"_npmOperationalInternal":{"tmp":"tmp/yoctocolors_2.1.2_1755616763470_0.8767246258360861","host":"s3://npm-registry-packages-npm-production"},"readme":"<sup>yoctocolors 🌈</sup>\n\n> The smallest and fastest command-line coloring package on the internet\n\n*Check out [Chalk](https://github.com/chalk/chalk) if you want something more mature and comprehensive.*\n\n## Highlights\n\n- Tiny\n- Fast\n- Handles nested colors\n- Tree-shakeable\n- No dependencies\n- Actively maintained\n\n## Install\n\nESM:\n\n```sh\nnpm install yoctocolors\n```\n\nOr CommonJS:\n\n```sh\nnpm install yoctocolors-cjs\n```\n\n## Usage\n\n```js\nimport colors from 'yoctocolors';\n\nconsole.log(colors.red('Yo!'));\n\nconsole.log(colors.blue(`Welcome to the ${colors.green('yoctocolors')} package!`));\n```\n\nYou can also import colors as named imports:\n\n```js\nimport {red, blue, green} from 'yoctocolors';\n\nconsole.log(red('Yo!'));\n\nconsole.log(blue(`Welcome to the ${green('yoctocolors')} package!`));\n```\n\n*This package supports [basic color detection](https://nodejs.org/api/tty.html#writestreamhascolorscount-env). 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.](https://nodejs.org/api/tty.html#writestreamgetcolordepthenv)*\n\n## Styles\n\n### Modifiers\n\n- `reset` - Reset the current style.\n- `bold` - Make the text bold.\n- `dim` - Make the text have lower opacity.\n- `italic` - Make the text italic. *(Not widely supported)*\n- `underline` - Put a horizontal line below the text. *(Not widely supported)*\n- `underlineDouble` - Put a double horizontal line below the text. *(Not widely supported)*\n- `underlineCurly` - Put a curly horizontal line below the text. *(Not widely supported)*\n- `underlineDotted` - Put a dotted horizontal line below the text. *(Not widely supported)*\n- `underlineDashed` - Put a dashed horizontal line below the text. *(Not widely supported)*\n- `overline` - Put a horizontal line above the text. *(Not widely supported)*\n- `inverse`- Invert background and foreground colors.\n- `hidden` - Print the text but make it invisible.\n- `strikethrough` - Put a horizontal line through the center of the text. *(Not widely supported)*\n\n### Colors\n\n- `black`\n- `red`\n- `green`\n- `yellow`\n- `blue`\n- `magenta`\n- `cyan`\n- `white`\n- `gray`\n- `redBright`\n- `greenBright`\n- `yellowBright`\n- `blueBright`\n- `magentaBright`\n- `cyanBright`\n- `whiteBright`\n\n### Background colors\n\n- `bgBlack`\n- `bgRed`\n- `bgGreen`\n- `bgYellow`\n- `bgBlue`\n- `bgMagenta`\n- `bgCyan`\n- `bgWhite`\n- `bgGray`\n- `bgRedBright`\n- `bgGreenBright`\n- `bgYellowBright`\n- `bgBlueBright`\n- `bgMagentaBright`\n- `bgCyanBright`\n- `bgWhiteBright`\n\n### Underline colors\n\nThe underline color is set independently of the text color, so the color is only visible when an underline style is also applied. For example, `underlineRed(underlineCurly('typo'))` renders a red squiggle below otherwise unstyled text. *(Not widely supported)*\n\n- `underlineBlack`\n- `underlineRed`\n- `underlineGreen`\n- `underlineYellow`\n- `underlineBlue`\n- `underlineMagenta`\n- `underlineCyan`\n- `underlineWhite`\n- `underlineGray`\n- `underlineRedBright`\n- `underlineGreenBright`\n- `underlineYellowBright`\n- `underlineBlueBright`\n- `underlineMagentaBright`\n- `underlineCyanBright`\n- `underlineWhiteBright`\n\n## Prior art\n\nYes\n\n## Benchmark\n\n```sh\n$ ./benchmark.js\n┌─────────┬────────────────┬─────────────┐\n│ (index) │ library        │ ops/sec     │\n├─────────┼────────────────┼─────────────┤\n│ 0       │ 'yoctocolors'  │ '8,000,000' │\n│ 1       │ 'colorette'    │ '8,000,000' │\n│ 2       │ 'picocolors'   │ '8,000,000' │\n│ 3       │ 'nanocolors'   │ '5,988,024' │\n│ 4       │ 'chalk'        │ '4,807,692' │\n│ 5       │ 'kleur/colors' │ '4,807,692' │\n│ 6       │ 'kleur'        │ '4,784,689' │\n│ 7       │ 'ansi-colors'  │ '2,178,649' │\n│ 8       │ 'cli-color'    │ '585,138'   │\n└─────────┴────────────────┴─────────────┘\n```\n\n*See [benchmark.js](benchmark.js).*\n\n## FAQ\n\n### What is yocto?\n\n[It was the smallest official unit prefix in the metric system until 2022.](https://en.wikipedia.org/wiki/Yocto-) Much smaller than nano.\n\n## Related\n\n- [yoctodelay](https://github.com/sindresorhus/yoctodelay) - Delay a promise a given amount of time\n- [chalk](https://github.com/chalk/chalk) - Terminal string styling\n","publish_time":1755616763680,"_cnpm_publish_time":1755616763680,"dist-tags":{"latest":"2.2.0"}}