{"id":13526844,"url":"https://github.com/felixfbecker/cli-highlight","last_synced_at":"2025-05-14T07:08:53.904Z","repository":{"id":10393777,"uuid":"65603553","full_name":"felixfbecker/cli-highlight","owner":"felixfbecker","description":"Syntax highlighting for your terminal 💻✨","archived":false,"fork":false,"pushed_at":"2025-04-23T16:45:32.000Z","size":1500,"stargazers_count":314,"open_issues_count":30,"forks_count":30,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-05-07T23:08:19.606Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://cli-highlight.surge.sh","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/felixfbecker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"zenodo":null}},"created_at":"2016-08-13T06:46:12.000Z","updated_at":"2025-05-06T14:35:09.000Z","dependencies_parsed_at":"2023-01-13T15:55:08.600Z","dependency_job_id":"c0fa5b3f-a819-4526-858e-44a69c195c06","html_url":"https://github.com/felixfbecker/cli-highlight","commit_stats":{"total_commits":111,"total_committers":10,"mean_commits":11.1,"dds":"0.32432432432432434","last_synced_commit":"01b7e45925499007e33d8637f967597b39838463"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixfbecker%2Fcli-highlight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixfbecker%2Fcli-highlight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixfbecker%2Fcli-highlight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixfbecker%2Fcli-highlight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/felixfbecker","download_url":"https://codeload.github.com/felixfbecker/cli-highlight/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253360733,"owners_count":21896374,"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-08-01T06:01:35.819Z","updated_at":"2025-05-14T07:08:48.893Z","avatar_url":"https://github.com/felixfbecker.png","language":"TypeScript","readme":"\n# cli-highlight\n\n\u003e Syntax highlighting in your terminal\n\n[![npm](https://img.shields.io/npm/v/cli-highlight.svg)](https://www.npmjs.com/package/cli-highlight)\n[![downloads](https://img.shields.io/npm/dm/cli-highlight.svg)](https://www.npmjs.com/package/cli-highlight)\n[![CI status](https://github.com/felixfbecker/cli-highlight/workflows/build/badge.svg?branch=main)](https://github.com/felixfbecker/cli-highlight/actions)\n[![codecov](https://codecov.io/gh/felixfbecker/cli-highlight/branch/main/graph/badge.svg)](https://codecov.io/gh/felixfbecker/cli-highlight)\n![node](http://img.shields.io/node/v/cli-highlight.svg)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n[![license](https://img.shields.io/npm/l/cli-highlight.svg)](https://github.com/felixfbecker/cli-highlight/blob/main/LICENSE.txt)\n\n## Example\n\n![Example Output](media/screenshot.svg)\n\n## CLI Usage\nOutput a file\n```sh\n$ highlight package.json\n```\n\nColor output of another program with piping. Example: A database migration script that logs SQL Queries\n```sh\n$ db-migrate --dry-run | highlight\n```\n\nCommand line options:\n```html\nUsage: highlight [options] [file]\n\nOutputs a file or STDIN input with syntax highlighting\n\nOptions:\n  --language, -l  Set the langugage explicitely\n                  If omitted will try to auto-detect\n  --theme, -t     Use a theme defined in a JSON file\n  --version, -v   Show version number                                   [boolean]\n  --help, -h      Show help                                             [boolean]\n```\n\n## Programmatic Usage\n\nYou can use this module programmatically to highlight logs of your Node app. Example:\n\n```js\nconst highlight = require('cli-highlight').highlight\nconst Sequelize = require('sequelize')\n\nconst db = new Sequelize(process.env.DB, {\n  logging(log) {\n    console.log(highlight(log, {language: 'sql', ignoreIllegals: true}))\n  }\n})\n```\n\nDetailed API documenation can be found [here](http://cli-highlight.surge.sh/).\n\n## Themes\nYou can write your own theme in a JSON file and pass it with `--theme`.\nThe key must be one of the [highlight.js CSS class names](http://highlightjs.readthedocs.io/en/latest/css-classes-reference.html) or `\"default\"`,\nand the value must be one or an array of [Chalk styles](https://github.com/chalk/chalk#styles) to be applied to that token.\n\n```json\n{\n  \"keyword\": \"blue\",\n  \"built_in\": [\"cyan\", \"dim\"],\n  \"string\": \"red\",\n  \"default\": \"gray\"\n}\n```\n\nThe style for `\"default\"` will be applied to any substrings not handled by highlight.js. The specifics depend on the language but this typically includes things like commas in parameter lists, semicolons at the end of lines, etc.\n\nThe theme is combined with the [default theme](http://cli-highlight.surge.sh/globals.html#default_theme).\nThe default theme is still not colored a lot or optimized for many languages, PRs welcome!\n\n## Supported Languages\n[All languages of highlight.js](https://highlightjs.org/static/demo/) are supported.\nCheck a [CI build](https://travis-ci.org/felixfbecker/cli-highlight) for examples of all the different languages and their highlighting.\n\n## Contributing\nThe module is written in TypeScript and can be compiled with `npm run build`.\n`npm run watch` starts `tsc` in watch mode. Tests are written with mocha.\n\nImproving language support is done by adding more colors to the tokens in the default theme and writing more tests.\n","funding_links":[],"categories":["Repository","TypeScript","others","Uncategorized"],"sub_categories":["Command-line Utilities","Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelixfbecker%2Fcli-highlight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffelixfbecker%2Fcli-highlight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelixfbecker%2Fcli-highlight/lists"}