{"id":13447074,"url":"https://github.com/jorgebucaran/colorette","last_synced_at":"2025-05-13T19:13:18.861Z","repository":{"id":31089024,"uuid":"34648097","full_name":"jorgebucaran/colorette","owner":"jorgebucaran","description":"🌈Easily set your terminal text color \u0026 styles","archived":false,"fork":false,"pushed_at":"2024-04-29T09:53:16.000Z","size":432,"stargazers_count":1613,"open_issues_count":9,"forks_count":54,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-04-19T06:57:06.980Z","etag":null,"topics":["ansi","browser","cli","colors","console","node","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/jorgebucaran.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-04-27T05:39:56.000Z","updated_at":"2025-04-09T15:20:31.000Z","dependencies_parsed_at":"2023-12-22T07:46:22.935Z","dependency_job_id":"967d6d38-25a9-43eb-8aee-422fa8c85b20","html_url":"https://github.com/jorgebucaran/colorette","commit_stats":{"total_commits":351,"total_committers":17,"mean_commits":"20.647058823529413","dds":0.05128205128205132,"last_synced_commit":"0928e67466a34e50b53c7a908f32e738c3904846"},"previous_names":["jorgebucaran/clorox","jorgebucaran/turbocolor","foldmap/colorette","jorgebucaran/colorette","joxji/colorette"],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorgebucaran%2Fcolorette","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorgebucaran%2Fcolorette/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorgebucaran%2Fcolorette/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorgebucaran%2Fcolorette/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jorgebucaran","download_url":"https://codeload.github.com/jorgebucaran/colorette/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250318591,"owners_count":21410960,"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","browser","cli","colors","console","node","terminal"],"created_at":"2024-07-31T05:01:07.493Z","updated_at":"2025-04-27T05:01:35.520Z","avatar_url":"https://github.com/jorgebucaran.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Repository","Packages","Styling \u0026 Output","cli"],"sub_categories":["Command-line Utilities","CLI"],"readme":"# 🌈Colorette\n\n\u003e Easily set your terminal text color \u0026 styles.\n\n- No dependecies\n- Automatic color support detection\n- Up to [2x faster](#benchmarks) than alternatives\n- TypeScript support\n- [`NO_COLOR`](https://no-color.org) friendly\n- Node \u003e= `10`\n\n\u003e [**Upgrading from Colorette `1.x`?**](https://github.com/jorgebucaran/colorette/issues/70)\n\n## Quickstart\n\n```js\nimport { blue, bold, underline } from \"colorette\"\n\nconsole.log(\n  blue(\"I'm blue\"),\n  bold(blue(\"da ba dee\")),\n  underline(bold(blue(\"da ba daa\")))\n)\n```\n\nHere's an example using [template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals).\n\n```js\nconsole.log(`\n  There's a ${underline(blue(\"house\"))},\n  With a ${bold(blue(\"window\"))},\n  And a ${blue(\"corvette\")}\n  And everything is blue\n`)\n```\n\nYou can also nest styles without breaking existing color sequences.\n\n```js\nconsole.log(bold(`I'm ${blue(`da ba ${underline(\"dee\")} da ba`)} daa`))\n```\n\nNeed to override terminal color detection? You can do that too.\n\n```js\nimport { createColors } from \"colorette\"\n\nconst { blue } = createColors({ useColor: false })\n\nconsole.log(blue(\"Blue? Nope, nah\"))\n```\n\n## Installation\n\n```console\nnpm install colorette\n```\n\n## API\n\n### \\\u003ccolor\\\u003e()\n\n\u003e See all [supported colors](#supported-colors).\n\n```js\nimport { blue } from \"colorette\"\n\nblue(\"I'm blue\") //=\u003e \\x1b[34mI'm blue\\x1b[39m\n```\n\n### createColors()\n\nOverride terminal color detection via `createColors({ useColor })`.\n\n```js\nimport { createColors } from \"colorette\"\n\nconst { blue } = createColors({ useColor: false })\n```\n\n### isColorSupported\n\n`true` if your terminal supports color, `false` otherwise. Used internally, but exposed for convenience.\n\n## Environment\n\nYou can override color detection from the CLI by setting the `--no-color` or `--color` flags.\n\n```console\n$ ./example.js --no-color | ./consumer.js\n```\n\nOr if you can't use CLI flags, by setting the `NO_COLOR=` or `FORCE_COLOR=` environment variables.\n\n```console\n$ NO_COLOR= ./example.js | ./consumer.js\n```\n\n## Supported colors\n\n| Colors  | Background Colors | Bright Colors | Bright Background Colors | Modifiers         |\n| ------- | ----------------- | ------------- | ------------------------ | ----------------- |\n| black   | bgBlack           | blackBright   | bgBlackBright            | dim               |\n| red     | bgRed             | redBright     | bgRedBright              | **bold**          |\n| green   | bgGreen           | greenBright   | bgGreenBright            | hidden            |\n| yellow  | bgYellow          | yellowBright  | bgYellowBright           | _italic_          |\n| blue    | bgBlue            | blueBright    | bgBlueBright             | \u003cu\u003eunderline\u003c/u\u003e  |\n| magenta | bgMagenta         | magentaBright | bgMagentaBright          | ~~strikethrough~~ |\n| cyan    | bgCyan            | cyanBright    | bgCyanBright             | reset             |\n| white   | bgWhite           | whiteBright   | bgWhiteBright            |                   |\n| gray    |                   |               |                          |                   |\n\n## [Benchmarks](https://github.com/jorgebucaran/colorette/actions/workflows/bench.yml)\n\n```console\nnpm --prefix bench start\n```\n\n```diff\n  chalk         1,786,703 ops/sec\n  kleur         1,618,960 ops/sec\n  colors          646,823 ops/sec\n  ansi-colors     786,149 ops/sec\n  picocolors    2,871,758 ops/sec\n+ colorette     3,002,751 ops/sec\n```\n\n## Acknowledgments\n\nColorette started out in 2015 by [@jorgebucaran](https://github.com/jorgebucaran) as a lightweight alternative to [Chalk](https://github.com/chalk/chalk) and was introduced originally as [Clor](https://github.com/jorgebucaran/colorette/commit/b01b5b9961ceb7df878583a3002e836fae9e37ce). Our terminal color detection logic borrows heavily from [@sindresorhus](https://github.com/sindresorhus) and [@Qix-](https://github.com/Qix-) work on Chalk. The idea of slicing strings to clear bleeding sequences was adapted from a similar technique used by [@alexeyraspopov](https://github.com/alexeyraspopov) in [picocolors](https://github.com/alexeyraspopov/picocolors). Thank you to all our contributors! \u003c3\n\n## License\n\n[MIT](LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjorgebucaran%2Fcolorette","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjorgebucaran%2Fcolorette","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjorgebucaran%2Fcolorette/lists"}