{"id":13575948,"url":"https://github.com/jaywcjlove/colors-cli","last_synced_at":"2025-04-06T08:14:10.552Z","repository":{"id":47151299,"uuid":"59317443","full_name":"jaywcjlove/colors-cli","owner":"jaywcjlove","description":" ಠ_ಠ  Terminal string styling done right.","archived":false,"fork":false,"pushed_at":"2024-06-26T02:45:38.000Z","size":600,"stargazers_count":76,"open_issues_count":2,"forks_count":14,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-29T11:13:55.757Z","etag":null,"topics":["256","ansi","ansi-escape","cli","color","colors","colors-cli","colour","command-line","command-line-tool","console","log","nodejs","rgb","shell","style","styles","terminal","xterm"],"latest_commit_sha":null,"homepage":"https://jaywcjlove.github.io/colors-cli","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jaywcjlove.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"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},"funding":{"ko_fi":"jaywcjlove","buy_me_a_coffee":"jaywcjlove","custom":["https://www.paypal.me/kennyiseeyou","https://jaywcjlove.github.io/#/sponsor"]}},"created_at":"2016-05-20T18:30:50.000Z","updated_at":"2024-08-22T17:22:47.000Z","dependencies_parsed_at":"2024-11-07T14:32:34.285Z","dependency_job_id":"4fb98a83-94ae-4a57-889f-ee5a05a4eafd","html_url":"https://github.com/jaywcjlove/colors-cli","commit_stats":{"total_commits":125,"total_committers":5,"mean_commits":25.0,"dds":0.03200000000000003,"last_synced_commit":"d3a3152ec2f087c46655e7d2a663ef637ed5fea5"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaywcjlove%2Fcolors-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaywcjlove%2Fcolors-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaywcjlove%2Fcolors-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaywcjlove%2Fcolors-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaywcjlove","download_url":"https://codeload.github.com/jaywcjlove/colors-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247451665,"owners_count":20940944,"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":["256","ansi","ansi-escape","cli","color","colors","colors-cli","colour","command-line","command-line-tool","console","log","nodejs","rgb","shell","style","styles","terminal","xterm"],"created_at":"2024-08-01T15:01:05.694Z","updated_at":"2025-04-06T08:14:10.532Z","avatar_url":"https://github.com/jaywcjlove.png","language":"JavaScript","funding_links":["https://ko-fi.com/jaywcjlove","https://buymeacoffee.com/jaywcjlove","https://www.paypal.me/kennyiseeyou","https://jaywcjlove.github.io/#/sponsor"],"categories":["JavaScript"],"sub_categories":[],"readme":"\u003cimg align=\"right\" height=\"150\" src=\"./img/colors-cli.png\"\u003e\n\n# colors-cli\n\n[![Buy me a coffee](https://img.shields.io/badge/Buy%20me%20a%20coffee-048754?logo=buymeacoffee)](https://jaywcjlove.github.io/#/sponsor)\n[![](https://jaywcjlove.github.io/sb/ico/npm.svg)](https://www.npmjs.com/package/colors-cli)\n[![build](https://github.com/jaywcjlove/colors-cli/actions/workflows/ci.yml/badge.svg)](https://github.com/jaywcjlove/colors-cli/actions/workflows/ci.yml)\n[![NPM Downloads](https://img.shields.io/npm/dm/colors-cli.svg?style=flat)](https://www.npmjs.com/package/colors-cli)\n\n\nTerminal string styling done right.  ಠ_ಠ \n\n\u003cimg src=\"img/screenshot.png\"\u003e\n\nInstall with npm:\n\n```bash\nnpm install colors-cli --save-dev\n```\n\n# Styles\n\n`bold`、 `faint`、 `italic`、 `underline`、 `blink`、 `overline`、 `inverse`、 `conceal`、 `strike`、\n\n# Colors\n\n\u003ctable\u003e\n  \u003cthead\u003e\u003cth\u003eForeground\u003c/th\u003e\u003cth\u003eBackground\u003c/th\u003e\u003cth\u003e\u003c/th\u003e\u003cth\u003eBright Foreground\u003c/th\u003e\u003cth\u003eBright Background\u003c/th\u003e\u003cth\u003e\u003c/th\u003e\u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eblack\u003c/td\u003e\n      \u003ctd\u003eblack_b\u003c/td\u003e\n      \u003ctd\u003e\u003cimg src=\"img/black.png?sanitize=true\" width=\"20\" height=\"20\" /\u003e\u003c/td\u003e\n      \u003ctd\u003eblack_bt\u003c/td\u003e\n      \u003ctd\u003eblack_bbt\u003c/td\u003e\n      \u003ctd\u003e\u003cimg src=\"img/black_bright.png?sanitize=true\" width=\"20\" height=\"20\" /\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003ered\u003c/td\u003e\n      \u003ctd\u003ered_b\u003c/td\u003e\n      \u003ctd\u003e\u003cimg src=\"img/red.png?sanitize=true\" width=\"20\" height=\"20\" /\u003e\u003c/td\u003e\n      \u003ctd\u003ered_bt\u003c/td\u003e\n      \u003ctd\u003ered_bbt\u003c/td\u003e\n      \u003ctd\u003e\u003cimg src=\"img/red_bright.png?sanitize=true\" width=\"20\" height=\"20\" /\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003egreen\u003c/td\u003e\n      \u003ctd\u003egreen_b\u003c/td\u003e\n      \u003ctd\u003e\u003cimg src=\"img/green.png?sanitize=true\" width=\"20\" height=\"20\" /\u003e\u003c/td\u003e\n      \u003ctd\u003egreen_bt\u003c/td\u003e\n      \u003ctd\u003egreen_bbt\u003c/td\u003e\n      \u003ctd\u003e\u003cimg src=\"img/green_bright.png?sanitize=true\" width=\"20\" height=\"20\" /\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eyellow\u003c/td\u003e\n      \u003ctd\u003eyellow_b\u003c/td\u003e\n      \u003ctd\u003e\u003cimg src=\"img/yellow.png?sanitize=true\" width=\"20\" height=\"20\" /\u003e\u003c/td\u003e\n      \u003ctd\u003eyellow_bt\u003c/td\u003e\n      \u003ctd\u003eyellow_bbt\u003c/td\u003e\n      \u003ctd\u003e\u003cimg src=\"img/yellow_bright.png?sanitize=true\" width=\"20\" height=\"20\" /\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eblue\u003c/td\u003e\n      \u003ctd\u003eblue_b\u003c/td\u003e\n      \u003ctd\u003e\u003cimg src=\"img/blue.png?sanitize=true\" width=\"20\" height=\"20\" /\u003e\u003c/td\u003e\n      \u003ctd\u003eblue_bt\u003c/td\u003e\n      \u003ctd\u003eblue_bbt\u003c/td\u003e\n      \u003ctd\u003e\u003cimg src=\"img/blue_bright.png?sanitize=true\" width=\"20\" height=\"20\" /\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003emagenta\u003c/td\u003e\n      \u003ctd\u003emagenta_b\u003c/td\u003e\n      \u003ctd\u003e\u003cimg src=\"img/magenta.png?sanitize=true\" width=\"20\" height=\"20\" /\u003e\u003c/td\u003e\n      \u003ctd\u003emagenta_bt\u003c/td\u003e\n      \u003ctd\u003emagenta_bbt\u003c/td\u003e\n      \u003ctd\u003e\u003cimg src=\"img/magenta_bright.png?sanitize=true\" width=\"20\" height=\"20\" /\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003ecyan\u003c/td\u003e\n      \u003ctd\u003ecyan_b\u003c/td\u003e\n      \u003ctd\u003e\u003cimg src=\"img/cyan.png?sanitize=true\" width=\"20\" height=\"20\" /\u003e\u003c/td\u003e\n      \u003ctd\u003ecyan_bt\u003c/td\u003e\n      \u003ctd\u003ecyan_bbt\u003c/td\u003e\n      \u003ctd\u003e\u003cimg src=\"img/cyan_bright.png?sanitize=true\" width=\"20\" height=\"20\" /\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003ewhite\u003c/td\u003e\n      \u003ctd\u003ewhite_b\u003c/td\u003e\n      \u003ctd\u003e\u003cimg src=\"img/white.png?sanitize=true\" width=\"20\" height=\"20\" /\u003e\u003c/td\u003e\n      \u003ctd\u003ewhite_bt\u003c/td\u003e\n      \u003ctd\u003ewhite_bbt\u003c/td\u003e\n      \u003ctd\u003e\u003cimg src=\"img/white_bright.png?sanitize=true\" width=\"20\" height=\"20\" /\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n## Basic usage:\n\nOutput colored text:\n\n```js\nvar color = require('colors-cli')\nconsole.log( color.red('hello') )\n```\n\nBest way is to predefine needed stylings and then use it:\n\n```js\nvar color = require('colors-cli/safe')\nvar error = color.red.bold;\nvar warn = color.yellow;\nvar notice = color.blue;\nconsole.log(error('Error!'));\nconsole.log(warn('Warning'));\nconsole.log(notice('Notice'));\n```\n\nStyles can be mixed:\n\n```js\nvar color = require('colors-cli/safe')\nconsole.log('=\u003e', color.red.bold.underline('hello') )\nconsole.log('=\u003e', color.magenta_bt.underline('hello ' + color.blue_bt('wo' + color.yellow_bt.magenta_bbt('r') + 'ld') + ' !!!!'));\nconsole.log('=\u003e', color.magenta_bt.underline('hello ' + color.blue_bt('wo' + color.yellow_bt.magenta_bbt('r'))));\nconsole.log('=\u003e', color.magenta_bt.underline('hello ' + color.blue_bt('world') + ' !!!!' + color.yellow('kenny') + ' wong' ));\n\nvar color = require('colors-cli/safe')\nrequire('colors-cli/toxic')\nconsole.log('=\u003e ' + color.underline('$ ' + 'npm'.magenta.underline + ' install'.yellow.underline + ' colors-cli --save-dev'));\n```\n\n\n```js\nrequire('colors-cli/toxic')\nconsole.log( 'hello'.green );\nconsole.log( 'hello'.green.black_b.underline );\nconsole.log('=\u003e $'.green + ' npm '.magenta + 'install '.yellow + 'colors-cli'.cyan + ' --save-dev');\n```\n\n# ANSI 256 colors\n\nSupport ANSI 256 colors. [0 - 255], The rules of method name. \n\n - Foreground `x32` \n - Background `xb32`\n\n```js\nvar color = require('colors-cli/safe')\nconsole.log( color.x45.bold.underline('hello') )\n\nrequire('colors-cli/toxic')\nconsole.log( 'hello'.x23.underline );\nconsole.log( 'hello'.green.xb34.underline );\n```\n\n\u003cimg src=\"./img/256_color.png\" width=\"450\"\u003e\n\n### Use the command line\n\n```bash\n Usage: colors\n\n Options:\n\n   --black  =\u003e black\n   --black_b  =\u003e black_b\n   --red  =\u003e red\n   ...\n\n Examples:\n\n   colors --red \"\\nhello world\" --bold,underline,yellow \"wcj\"\n   colors --green,bold \"\\nhello world\"\n   colors --x12,bold \"hello world\"\n```\n\n\n# Reference\n\n- [The opaque named colors](https://drafts.csswg.org/css-color/#named-colors)\n- [ANSI escape code](https://en.wikipedia.org/wiki/ANSI_escape_code)\n\n\nThe [ANSI Escape](https://en.wikipedia.org/wiki/ANSI_escape_code) sequences control code screen.\n\n```bash\necho -e \"\\033[31;41;4m something here 33[0m\"\n```\n\n`\\033` As the escape character, inform the terminal to switch to the escape mode.  \n`[` The beginning of the CSI.  \n`m` Make the action to be performed.  \n`;` ASCII code separator.  \n\n# License\n\nLicensed under the MIT License.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaywcjlove%2Fcolors-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaywcjlove%2Fcolors-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaywcjlove%2Fcolors-cli/lists"}