{"id":13492711,"url":"https://github.com/sindresorhus/yoctocolors","last_synced_at":"2025-05-14T15:05:51.041Z","repository":{"id":41370118,"uuid":"412371797","full_name":"sindresorhus/yoctocolors","owner":"sindresorhus","description":"The smallest and fastest command-line coloring package on the internet","archived":false,"fork":false,"pushed_at":"2024-10-28T05:11:31.000Z","size":32,"stargazers_count":776,"open_issues_count":1,"forks_count":30,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-05-07T09:25:35.124Z","etag":null,"topics":["ansi","ansi-escape-codes","cli","color","command-line","console","javascript","nodejs","terminal"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sindresorhus.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/security.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"sindresorhus","open_collective":"sindresorhus","buy_me_a_coffee":"sindresorhus","custom":"https://sindresorhus.com/donate"}},"created_at":"2021-10-01T07:30:54.000Z","updated_at":"2025-05-06T19:33:10.000Z","dependencies_parsed_at":"2024-03-04T05:08:15.016Z","dependency_job_id":"598cf199-9833-4499-bd88-a70cef3849a4","html_url":"https://github.com/sindresorhus/yoctocolors","commit_stats":{"total_commits":28,"total_committers":7,"mean_commits":4.0,"dds":0.2857142857142857,"last_synced_commit":"366d515357373a0d6c1494ca08d541f0f80ceb61"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fyoctocolors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fyoctocolors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fyoctocolors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fyoctocolors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sindresorhus","download_url":"https://codeload.github.com/sindresorhus/yoctocolors/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254169005,"owners_count":22026207,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansi","ansi-escape-codes","cli","color","command-line","console","javascript","nodejs","terminal"],"created_at":"2024-07-31T19:01:08.511Z","updated_at":"2025-05-14T15:05:51.020Z","avatar_url":"https://github.com/sindresorhus.png","language":"JavaScript","funding_links":["https://github.com/sponsors/sindresorhus","https://opencollective.com/sindresorhus","https://buymeacoffee.com/sindresorhus","https://sindresorhus.com/donate"],"categories":["JavaScript","cli"],"sub_categories":[],"readme":"\u003csup\u003eyoctocolors 🌈\u003c/sup\u003e\n\n\u003e 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 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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fyoctocolors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsindresorhus%2Fyoctocolors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fyoctocolors/lists"}