{"name":"yoctocolors","version":"2.1.0","description":"The smallest and fastest command-line coloring package on the internet","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/yoctocolors.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava && tsd"},"keywords":["color","colour","colors","terminal","console","cli","string","ansi","style","styles","tty","formatting","shell","xterm","log","logging","command-line","text"],"devDependencies":{"@jonahsnider/benchmark":"^5.0.3","ansi-colors":"^4.1.3","ava":"^6.1.3","chalk":"^5.3.0","cli-color":"^2.0.4","colorette":"^2.0.20","kleur":"^4.1.5","nanocolors":"^0.2.13","picocolors":"^1.0.1","tsd":"^0.31.0","xo":"^0.58.0"},"ava":{"environmentVariables":{"FORCE_COLOR":"1"}},"_id":"yoctocolors@2.1.0","gitHead":"13133224296d11ac752d24c68ced411594447e9e","types":"./index.d.ts","bugs":{"url":"https://github.com/sindresorhus/yoctocolors/issues"},"homepage":"https://github.com/sindresorhus/yoctocolors#readme","_nodeVersion":"20.12.2","_npmVersion":"10.6.0","dist":{"integrity":"sha512-FsQpXXeOEe05tcJN4Z2eicuC6+6KiJdBbPOAChanSkwwjZ277XGsh8wh/HaPuGeifTiw/7dgAzabitu2bnDvRg==","shasum":"27c6b15d38f7659d640580a7c4981bd56b59bcb9","tarball":"http://registry-npm.ywwl.com/yoctocolors/download/yoctocolors-2.1.0.tgz","fileCount":7,"unpackedSize":10094,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHebNx/PZG9wBX3VA91zuviRaKrp+05hOG4fcr5Fzuk3AiEA09RvLct/L5DeP822vAQWOcpuU2oB+RFsf/f3u7TrB2c="}],"size":3801,"noattachment":false,"key":"/yoctocolors/-/yoctocolors-2.1.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/yoctocolors_2.1.0_1719653428744_0.42383293477003225"},"_hasShrinkwrap":false,"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\n```sh\nnpm install yoctocolors\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 above the text. *(Not widely supported)*\n- `overline` - Put a horizontal line below 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## 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":1719653428911,"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_cnpm_publish_time":1719653428911,"dist-tags":{"latest":"2.2.0"}}