{"id":15361953,"url":"https://github.com/tj/node-term-css","last_synced_at":"2025-06-10T12:40:46.587Z","repository":{"id":4086993,"uuid":"5193459","full_name":"tj/node-term-css","owner":"tj","description":"style terminal output using CSS","archived":false,"fork":false,"pushed_at":"2012-07-26T17:25:21.000Z","size":119,"stargazers_count":117,"open_issues_count":5,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-28T18:15:06.297Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/tj.png","metadata":{"files":{"readme":"Readme.md","changelog":"History.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-07-26T15:00:37.000Z","updated_at":"2024-07-15T04:09:05.000Z","dependencies_parsed_at":"2022-07-17T06:00:43.393Z","dependency_job_id":null,"html_url":"https://github.com/tj/node-term-css","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/tj%2Fnode-term-css","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tj%2Fnode-term-css/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tj%2Fnode-term-css/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tj%2Fnode-term-css/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tj","download_url":"https://codeload.github.com/tj/node-term-css/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249026684,"owners_count":21200490,"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":[],"created_at":"2024-10-01T12:57:34.523Z","updated_at":"2025-04-15T07:30:51.549Z","avatar_url":"https://github.com/tj.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# term-css\n\n  Terminal CSS styling using [node-css](https://github.com/visionmedia/node-css).\n\n## Installation\n\n    $ npm install term-css\n\n## Example\n\njs:\n\n```js\n\nvar css = require('term-css')\n  , fs = require('fs')\n  , style = fs.readFileSync('pet.css', 'utf8');\n\nvar tobi = {\n  name: 'tobi',\n  species: 'ferret',\n  age: 2\n};\n\nvar loki = {\n  name: 'loki',\n  species: 'ferret',\n  age: 1\n};\n\nvar fn = css.compile('  {name} is a {species}, he is {age} years old', style);\n\nconsole.log();\nconsole.log(fn(tobi));\nconsole.log(fn(loki));\nconsole.log();\n\n```\n\ncss:\n\n```css\nname {\n  color: cyan;\n  font-weight: bold;\n}\n\nspecies {\n  color: white;\n  font-weight: bold;\n  background: black;\n}\n\nage {\n  color: red;\n  text-decoration: underline;\n}\n```\n\noutput:\n\n  ![](http://f.cl.ly/items/0Q0q2b1H1c1u0x0V0o0m/Screen%20Shot%202012-07-26%20at%208.03.34%20AM.png)\n\n## CSS properties\n\n  The following CSS properties / values are understood:\n  \n  - `text-decoration: \u003cunderline|inverse\u003e`\n  - `font-weight: \u003cbold\u003e`\n  - `font-style: \u003citalic\u003e`\n  - `color: \u003cgrey|gray|black|blue|cyan|green|red|magenta|yellow\u003e`\n  - `background: \u003cgrey|gray|black|blue|cyan|green|red|magenta|yellow\u003e`\n\n## Substitution\n\n  term-css substitutes tokens with properties in the object passed,\n  for example `{name}` will access `{ name: \"tobi\" }`, whereas \n  `{labels.visits}` will access `{ labels: { visits: 'Visits' } }`.\n\n  For styling purposes you may also assign a classname, for example\n  instead of styling \"labels.visits\", \"labels.uptime\" separately,\n  you may use `{label labels.visits}` and `{label labels.uptime}`.\n\n## Omitting styles\n\n To output a plain string but use the same format, simply omit the css\n string from the `.compile(fmt, style)` call.\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2012 TJ Holowaychuk \u0026lt;tj@vision-media.ca\u0026gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftj%2Fnode-term-css","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftj%2Fnode-term-css","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftj%2Fnode-term-css/lists"}