{"id":19873965,"url":"https://github.com/metarhia/concolor","last_synced_at":"2025-04-07T19:15:10.801Z","repository":{"id":16650330,"uuid":"80385239","full_name":"metarhia/concolor","owner":"metarhia","description":"Colouring template strings using tags with annotations 🎨","archived":false,"fork":false,"pushed_at":"2025-01-01T12:08:58.000Z","size":499,"stargazers_count":44,"open_issues_count":1,"forks_count":0,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-07T00:45:56.568Z","etag":null,"topics":["ansi","color","colors","console","impress","javascript","metarhia","nodejs"],"latest_commit_sha":null,"homepage":"https://metarhia.com","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/metarhia.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null},"funding":{"patreon":"tshemsedinov"}},"created_at":"2017-01-30T01:19:10.000Z","updated_at":"2025-01-22T07:20:47.000Z","dependencies_parsed_at":"2023-09-28T02:25:28.145Z","dependency_job_id":"9c7c48bd-42ca-4e81-b919-cda6ed908640","html_url":"https://github.com/metarhia/concolor","commit_stats":{"total_commits":99,"total_committers":6,"mean_commits":16.5,"dds":"0.12121212121212122","last_synced_commit":"dbba76fbe6c8f230b4c74e3a301a5b3e3fddfa1b"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metarhia%2Fconcolor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metarhia%2Fconcolor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metarhia%2Fconcolor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metarhia%2Fconcolor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metarhia","download_url":"https://codeload.github.com/metarhia/concolor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247713258,"owners_count":20983683,"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","color","colors","console","impress","javascript","metarhia","nodejs"],"created_at":"2024-11-12T16:20:44.262Z","updated_at":"2025-04-07T19:15:10.726Z","avatar_url":"https://github.com/metarhia.png","language":"JavaScript","funding_links":["https://patreon.com/tshemsedinov"],"categories":[],"sub_categories":[],"readme":"# Concolor\n\n[![ci status](https://github.com/metarhia/concolor/workflows/Testing%20CI/badge.svg)](https://github.com/metarhia/concolor/actions?query=workflow%3A%22Testing+CI%22+branch%3Amaster)\n[![snyk](https://snyk.io/test/github/metarhia/impress/badge.svg)](https://snyk.io/test/github/metarhia/impress)\n[![npm version](https://badge.fury.io/js/concolor.svg)](https://badge.fury.io/js/concolor)\n[![npm downloads/month](https://img.shields.io/npm/dm/concolor.svg)](https://www.npmjs.com/package/concolor)\n[![npm downloads](https://img.shields.io/npm/dt/concolor.svg)](https://www.npmjs.com/package/concolor)\n\nConcolor is a simple library for Node.js for coloring templated strings using\ntags with annotations\n\n## Usage\n\n- Install: `npm install concolor`\n- Require: `const concolor = require('concolor');`\n- Now you have 4 use cases:\n  - [string template tag](#string-tag)\n  - [tag factory](#tag-factory)\n  - [style function](#style-function)\n  - [themes](#themes)\n\n## String tag\n\n```js\nconsole.log(concolor`text ${expression}(styles)`);\n```\n\nExamples:\n\n```javascript\nconsole.log(concolor`Ave ${'World'}(blue) blue`);\nconsole.log(concolor`Ave ${'World'}(/red) on red`);\nconsole.log(concolor`Ave ${'World'}(white/yellow,b) bold white on yellow`);\nconsole.log(concolor`Ave ${'World'}(b) bold`);\nconsole.log(concolor`Ave ${'World'}(b,/blue) bold on blue`);\nconsole.log(concolor`Ave ${'World'}(b,u,yellow) bold underline yellow`);\nconsole.log(concolor`Ave ${'World'}(blue,u) blue underline`);\nconsole.log(concolor`Ave ${'World'}(b,black/green) bold black on green`);\n\nconsole.log(concolor`\n  Client on ${'192.168.1.1'}(black/green)\n  connected to ${'SERVER'}(b,red)\n  at ${new Date().toUTCString()}(b,blue)\n`);\n```\n\n## Tag factory\n\n```js\nconst tag = concolor(styles);\nconsole.log(tag`text`);\n```\n\nExamples:\n\n```javascript\nconst warn = concolor('b,yellow');\nconst err = concolor('b,yellow/red');\nconst inf = concolor('i,white');\n\nconsole.log(warn`test1 ${'text2'} text3`);\nconsole.log(err`test4 ${'text5'} text6`);\nconsole.log(inf`test7 ${'text8'} text9`);\n```\n\n## Style function\n\n```js\nconst style = concolor(styles);\nconsole.log(style('text'));\n```\n\nExamples:\n\n```javascript\nconst warn = concolor('b,yellow');\nconst err = concolor('b,yellow/red');\nconst inf = concolor('i,white');\n\nconsole.log(warn(`test1 ${'text2'} text3`));\nconsole.log(err(`test4 ${'text5'} text6`));\nconsole.log(inf(`test7 ${'text8'} text9`));\n```\n\n## Themes\n\n```js\nconst theme = concolor({\n  caption: 'b,white',\n  text: 'green',\n  link: 'u,yellow',\n});\n\nconst caption = 'Caption';\nconst text = 'Here is a text';\nconst link = 'http://metarhia.com';\n\nconsole.log(theme`  ${{ caption }}\n  ${{ text }}\n  ${{ link }}`);\n```\n\n## Themes as functions\n\n```js\nconst theme = concolor({\n  caption: 'b,white',\n  text: 'green',\n  link: 'u,yellow',\n});\n\nconsole.log(theme.caption('Caption example'));\n```\n\n## License \u0026 Contributors\n\nCopyright (c) 2017-2025 [Metarhia contributors](https://github.com/metarhia/concolor/graphs/contributors).\nConcolor is [MIT licensed](./LICENSE).\\\nConcolor is a part of [Metarhia](https://github.com/metarhia) technology stack.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetarhia%2Fconcolor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetarhia%2Fconcolor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetarhia%2Fconcolor/lists"}