{"_id":"yoctocolors-cjs","_rev":"4-7a178cee3be65aabe3962040705b2ef1","name":"yoctocolors-cjs","dist-tags":{"latest":"2.1.3"},"versions":{"2.1.0":{"name":"yoctocolors-cjs","version":"2.1.0","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-cjs@2.1.0","homepage":"https://github.com/sindresorhus/yoctocolors#readme","bugs":{"url":"https://github.com/sindresorhus/yoctocolors/issues"},"ava":{"environmentVariables":{"FORCE_COLOR":"1"}},"dist":{"shasum":"93ffbd28405d9f412792bcda4dc6145ec3029b9f","tarball":"https://registry.npmjs.org/yoctocolors-cjs/-/yoctocolors-cjs-2.1.0.tgz","fileCount":5,"integrity":"sha512-T6hE/db6DjMqdZ8Pz0XCqUPnjJAWXukWFj7G7lzcx0arYfUSOr9DzYpxW7uT4LNcF4I5C6xouUE7tFNvfppEmQ==","signatures":[{"sig":"MEQCIF5p+UJFVSkNHVrOCreERaX7IKGICEbMPO9LGHBq7minAiBKYGT10j+xBhrSwYWiB+Bi2Ma5KYkNJdMgKZhsb3XqLQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11102},"main":"./index.js","type":"commonjs","types":"./index.d.ts","engines":{"node":">=18"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"ba8bfa76bb8b9013d8b4cf6832ac6847e53057dd","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.6.0","description":"CommonJS version - The smallest and fastest command-line coloring package on the internet","directories":{},"sideEffects":false,"_nodeVersion":"18.20.2","_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-cjs_2.1.0_1719689841518_0.2251624956490117","host":"s3://npm-registry-packages"}},"2.1.1":{"name":"yoctocolors-cjs","version":"2.1.1","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-cjs@2.1.1","homepage":"https://github.com/sindresorhus/yoctocolors#readme","bugs":{"url":"https://github.com/sindresorhus/yoctocolors/issues"},"ava":{"environmentVariables":{"FORCE_COLOR":"1"}},"dist":{"shasum":"1a096cffaeda2eb725e33b19735681875465c920","tarball":"https://registry.npmjs.org/yoctocolors-cjs/-/yoctocolors-cjs-2.1.1.tgz","fileCount":5,"integrity":"sha512-c6T13b6qYcJZvck7QbEFXrFX/Mu2KOjvAGiKHmYMUg96jxNpfP6i+psGW72BOPxOIDUJrORG+Kyu7quMX9CQBQ==","signatures":[{"sig":"MEUCIAh92zwBcZqWGi811GtYwQ9ENQAIAib7fbw4tlhaJCQQAiEAlxzACfPhBaljQkuJXQLZMf/8YUPf65k4Epu3Zs5uNi4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":10637},"main":"./index.js","type":"commonjs","types":"./index.d.ts","engines":{"node":">=18"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"061aa1b9b6907f87b1b0d7f5a0efd60cf8f7ab46","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.6.0","description":"CommonJS version - The smallest and fastest command-line coloring package on the internet","directories":{},"sideEffects":false,"_nodeVersion":"18.20.2","_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-cjs_2.1.1_1719690658681_0.6942502708904801","host":"s3://npm-registry-packages"}},"2.1.2":{"name":"yoctocolors-cjs","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-cjs@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":"f4b905a840a37506813a7acaa28febe97767a242","tarball":"https://registry.npmjs.org/yoctocolors-cjs/-/yoctocolors-cjs-2.1.2.tgz","fileCount":5,"integrity":"sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==","signatures":[{"sig":"MEQCIEAxhpddsIwKskgkTcRDHEgqfm6cG882PGn2oOfUmuyrAiAFgk4Lwd3r+2JRj3UEAbi6sE+Yy1Z+Z+A3uhzzGDNArQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":10694},"main":"./index.js","type":"commonjs","types":"./index.d.ts","engines":{"node":">=18"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"894db35811c39683a727d86857816b1b1f874d73","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.6.0","description":"CommonJS version - The smallest and fastest command-line coloring package on the internet","directories":{},"sideEffects":false,"_nodeVersion":"18.20.2","_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-cjs_2.1.2_1720048751712_0.1901768766143055","host":"s3://npm-registry-packages"}},"2.1.3":{"name":"yoctocolors-cjs","version":"2.1.3","description":"CommonJS version - 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":"commonjs","main":"./index.js","types":"./index.d.ts","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-cjs@2.1.3","gitHead":"156ae5626c7a47bff6c976cc48535f2e37571a63","bugs":{"url":"https://github.com/sindresorhus/yoctocolors/issues"},"homepage":"https://github.com/sindresorhus/yoctocolors#readme","_nodeVersion":"20.19.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-U/PBtDf35ff0D8X8D0jfdzHYEPFxAI7jJlxZXwCSez5M3190m+QobIfh+sWDWSHMCWWJN2AWamkegn6vr6YBTw==","shasum":"7e4964ea8ec422b7a40ac917d3a344cfd2304baa","tarball":"https://registry.npmjs.org/yoctocolors-cjs/-/yoctocolors-cjs-2.1.3.tgz","fileCount":5,"unpackedSize":11049,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD0fu4id1+n1GPwZRE/nPO8jaM++uqx8WJtMKK9503wrQIgL1171UEtSVicoPcqT3lOC74iACUxjhFQ9KmsZzMxU20="}]},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/yoctocolors-cjs_2.1.3_1755764687577_0.4998247959117035"},"_hasShrinkwrap":false}},"time":{"created":"2024-06-29T19:37:21.517Z","modified":"2025-08-21T08:24:47.932Z","2.1.0":"2024-06-29T19:37:21.705Z","2.1.1":"2024-06-29T19:50:58.841Z","2.1.2":"2024-07-03T23:19:11.886Z","2.1.3":"2025-08-21T08:24:47.792Z"},"bugs":{"url":"https://github.com/sindresorhus/yoctocolors/issues"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"license":"MIT","homepage":"https://github.com/sindresorhus/yoctocolors#readme","keywords":["color","colour","colors","terminal","console","cli","string","ansi","style","styles","tty","formatting","shell","xterm","log","logging","command-line","text"],"repository":{"type":"git","url":"git+https://github.com/sindresorhus/yoctocolors.git"},"description":"CommonJS version - The smallest and fastest command-line coloring package on the internet","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"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","readmeFilename":"readme.md"}