{"id":21062129,"url":"https://github.com/gughog/clr-js","last_synced_at":"2026-05-04T10:41:39.931Z","repository":{"id":36384295,"uuid":"217422347","full_name":"gughog/clr-js","owner":"gughog","description":"A simple library for Node.js CLI apps to colorize and add some life to bash texts. (WIP) ","archived":false,"fork":false,"pushed_at":"2023-01-05T01:40:53.000Z","size":569,"stargazers_count":2,"open_issues_count":16,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-06T12:04:23.369Z","etag":null,"topics":["bash","cli","clr","clr-js","color","library","nodejs","opensource"],"latest_commit_sha":null,"homepage":"https://gughog.github.io/clr-js/","language":"TypeScript","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/gughog.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-25T01:01:23.000Z","updated_at":"2023-02-11T12:17:36.000Z","dependencies_parsed_at":"2023-01-17T01:00:43.818Z","dependency_job_id":null,"html_url":"https://github.com/gughog/clr-js","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gughog%2Fclr-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gughog%2Fclr-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gughog%2Fclr-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gughog%2Fclr-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gughog","download_url":"https://codeload.github.com/gughog/clr-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243505963,"owners_count":20301619,"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":["bash","cli","clr","clr-js","color","library","nodejs","opensource"],"created_at":"2024-11-19T17:37:20.844Z","updated_at":"2025-12-30T15:52:19.318Z","avatar_url":"https://github.com/gughog.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Clr.js - The dead-simple terminal colors for Node.js.\n\nClr is a dead simple color library for nodejs to colorize things and put some styles to your strings in your terminal. It's a Work-in-progress (WIP) currently in the 1.0.0 version, yay!\n\nActually clr-js is just a project for fun, to learn new things and to play with some nice features of the world of development. If you have a better approach to this, please, contribute! Or if you just want to install for create your terminal based apps, feel free to do it.\n\nThis is my first open-source contribution, so if you find any errors, bugs or something bad, please report and let's learn together. :smile:\n\n## Getting started\n\n### Installation\n\n* With NPM:\n`npm install clr-js`\n\n* With Yarn:\n`yarn add clr-js`\n\n---\n\n### Usage (New 1.0.0 version)\n\nThis 1.0.0 version introduces the chaining methods for Clr-js! To use in your Javascript/Typescript file:\n\n```js\nconst clr = require('clr-js');\n\n// A bold and yellow text will be shown in your terminal!\nconsole.log(\n  clr.bold('Hello, javascript colorful world!')\n     .yellow()\n     .it();\n)\n```\n\n```ts\nimport * as clr from '../clr';\n\nconsole.log(\n  clr.bold('Hello, typescript colorful world!')\n     .blue()\n     .it();\n)\n```\n\nNotice: You only need to declare the string you'll paint in the first method.\n\nNotice2: A little tweak was made for finish the method chaining: when you done calling all your methods, finish the chain with `.it()`.\n\n## API (ver. 1.0.0)\n\n### Colors:\n\nColor       | Applying to text          | Applying to background\n------------|---------------------------|-----------------------\n Blue       | `clr.blue(\u003cstr\u003e).it()`    | `clr.bblue(\u003cstr\u003e).it()`\n Red        | `clr.red(\u003cstr\u003e).it()`     | `clr.bred(\u003cstr\u003e).it()`\n Yellow     | `clr.yellow(\u003cstr\u003e).it()`  | `clr.byellow(\u003cstr\u003e).it()`\n Green      | `clr.green(\u003cstr\u003e).it()`   | `clr.bgreen(\u003cstr\u003e).it()`\n Cyan       | `clr.cyan(\u003cstr\u003e).it()`    | `clr.bcyan(\u003cstr\u003e).it()`\n Magenta    | `clr.magenta(\u003cstr\u003e).it()` | `clr.bmagenta(\u003cstr\u003e).it()`\n White      | `clr.white(\u003cstr\u003e).it()`   | `clr.bwhite(\u003cstr\u003e).it()`\n Black      | `clr.black(\u003cstr\u003e).it()`   | `clr.bblack(\u003cstr\u003e).it()`\n\n### Special Text Formatting\n\nText Formatting | Method \n----------------|--------\n Bold text      | `clr.bold(\u003cstr\u003e).it()`\n Underlined     | `clr.uline(\u003cstr\u003e).it()`\n Dark text      | `clr.darky(\u003cstr\u003e).it()`\n Stroke         | `clr.stroke(\u003cstr\u003e).it()`\n\n### Applying Special formatting and colors in texts:\n\n```js\nconst clr = require('clr-js');\n\nlet stringy = 'My colorful string.';\n\n// Bold and blue text;\nconsole.log(\n  clr.bold(stringy)\n     .blue()\n     .it();\n)\n\n// Bold, underlined magenta-colored text;\nconsole.log(\n  clr.bold(stringy)\n     .uline()\n     .magenta()\n     .it();\n)\n\n// White background with black text;\nconsole.log(\n  clr.bwhite(stringy)\n     .black()\n     .it();\n)\n\n// Or just use inline\nconsole.log(\n  clr.bwhite(stringy).black().it();\n)\n\n```\n\n---\n---\n\n## The guide bellow refers to the old version of Clr-js, and is not compatible with 1.0.0!\n\n### Usage (ver. 0.1.7 and bellow only)\n\nTo use in your Javascript/Typescript file:\n\n```js\nconst clr = require('clr-js');\n\n// A bold and blue text will be shown in your terminal!\nconsole.log(clr.bold(clr.blue('Hello, colorful world!')))\n```\n\n## API\n\n### Colors:\n\nColor       | Applying to text     | Applying to background\n------------|----------------------|-----------------------\n Blue       | `clr.blue(\u003cstr\u003e)`    | `clr.bblue(\u003cstr\u003e)`\n Red        | `clr.red(\u003cstr\u003e)`     | `clr.bred(\u003cstr\u003e)`\n Yellow     | `clr.yellow(\u003cstr\u003e)`  | `clr.byellow(\u003cstr\u003e)`\n Green      | `clr.green(\u003cstr\u003e)`   | `clr.bgreen(\u003cstr\u003e)`\n Cyan       | `clr.cyan(\u003cstr\u003e)`    | `clr.bcyan(\u003cstr\u003e)`\n Magenta    | `clr.magenta(\u003cstr\u003e)` | `clr.bmagenta(\u003cstr\u003e)`\n White      | `clr.white(\u003cstr\u003e)`   | `clr.bwhite(\u003cstr\u003e)`\n Black      | `clr.black(\u003cstr\u003e)`   | `clr.bblack(\u003cstr\u003e)`\n\n### Special Text Formatting\n\nText Formatting | Method \n----------------|--------\n Bold text      | `clr.bold(\u003cstr\u003e)`\n Underlined     | `clr.uline(\u003cstr\u003e)`\n Dark text      | `clr.darky(\u003cstr\u003e)`\n Stroke         | `clr.stroke(\u003cstr\u003e)`\n\n### Applying Special formatting in colored texts:\n\n```js\nlet stringy = 'My colorful string.';\n\nconsole.log( clr.bold(clr.blue(stringy)) ) // Bold and blue text;\nconsole.log( clr.bold(clr.uline(clr.magenta(stringy))) ) // Bold, underlined magenta-colored text;\nconsole.log( clr.bwhite(clr.black(stringy)) ) // White background with black text;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgughog%2Fclr-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgughog%2Fclr-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgughog%2Fclr-js/lists"}