{"_id":"@acarl005/cli-highlight","_rev":"1-c91efffd1bfad4a8d183bce67d7a0e9f","name":"@acarl005/cli-highlight","description":"Syntax highlighting in your terminal","dist-tags":{"latest":"1.1.5"},"versions":{"1.1.5":{"name":"@acarl005/cli-highlight","version":"1.1.5","description":"Syntax highlighting in your terminal","main":"dist/index.js","typings":"dist/index.d.ts","bin":{"highlight":"./bin/highlight"},"engines":{"node":">=4.0.0"},"scripts":{"test":"mocha dist/test","build":"tsc -p .","watch":"tsc -p . -w","typedoc":"typedoc --media media --mode file --excludeNotExported --out typedoc src/index.ts typings/index.d.ts"},"repository":{"type":"git","url":"git+https://github.com/felixfbecker/cli-highlight.git"},"keywords":["terminal","syntax","highlight","color","cli","ansi"],"contributors":[{"name":"Felix Becker","email":"felix.b@outlook.com"},{"name":"Andrew Carlson","email":"acarl005@g.ucla.edu"}],"license":"ISC","bugs":{"url":"https://github.com/felixfbecker/cli-highlight/issues"},"homepage":"https://github.com/felixfbecker/cli-highlight#readme","dependencies":{"chalk":"^1.1.3","he":"^1.1.0","highlight.js":"^9.6.0","mz":"^2.4.0","yargs":"^4.8.1"},"devDependencies":{"mocha":"^3.0.2","tslint":"^3.14.0","typedoc":"^0.4.4","typescript":"^1.8.10","typings":"^1.3.2"},"gitHead":"cc2e8a0521266f1170170ab57d1504d20ab04db4","_id":"@acarl005/cli-highlight@1.1.5","_npmVersion":"5.3.0","_nodeVersion":"8.1.3","_npmUser":{"name":"acarl005","email":"acarl005@g.ucla.edu"},"dist":{"integrity":"sha512-2y8ys5QEFAVC8OPULXbqBmizigUlUIk86Fkww6CWHQROamM/LFIDFr4RTy0YPoqm3CSYkaaEro/467VeGCj1Uw==","shasum":"f3486540669d9fed228b456b6282cd5987ef77ae","tarball":"https://registry.npmjs.org/@acarl005/cli-highlight/-/cli-highlight-1.1.5.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCfNNqBQye2qeUvPZa4YaSAf+wTtHkXsEh7lp+ty4gLcwIgHMeMeImuZo5ZOjRjzk+Rs+laf+ZuFziGjXtZ4hxw1P0="}]},"maintainers":[{"name":"acarl005","email":"acarl005@g.ucla.edu"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cli-highlight-1.1.5.tgz_1500336634009_0.12472713645547628"}}},"readme":"\n# `cli-highlight`\n\n> Syntax highlighting in your terminal\n\n[![Version](https://img.shields.io/npm/v/cli-highlight.svg)](https://www.npmjs.com/package/cli-highlight)\n[![Downloads](https://img.shields.io/npm/dt/cli-highlight.svg)](https://www.npmjs.com/package/cli-highlight)\n[![Build Status](https://travis-ci.org/felixfbecker/cli-highlight.svg?branch=master)](https://travis-ci.org/felixfbecker/cli-highlight)\n![Dependencies](https://david-dm.org/felixfbecker/cli-highlight.svg)\n![Node Version](http://img.shields.io/node/v/cli-highlight.svg)\n[![License](https://img.shields.io/npm/l/cli-highlight.svg)](https://github.com/felixfbecker/cli-highlight/blob/master/LICENSE.txt)\n\n## Example\n\n[![Example Test Output](media/tests.png)](https://travis-ci.org/felixfbecker/cli-highlight)\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)\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}\n```\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\nIn theory, [all languages of highlight.js](https://highlightjs.org/static/demo/) are supported - I just did not adapt\nthe default theme and wrote tests for all languages yet. My primary use case was SQL so that is supported well.\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","maintainers":[{"name":"acarl005","email":"acarl005@g.ucla.edu"}],"time":{"modified":"2022-04-04T11:06:18.556Z","created":"2017-07-18T00:10:34.115Z","1.1.5":"2017-07-18T00:10:34.115Z"},"homepage":"https://github.com/felixfbecker/cli-highlight#readme","keywords":["terminal","syntax","highlight","color","cli","ansi"],"repository":{"type":"git","url":"git+https://github.com/felixfbecker/cli-highlight.git"},"contributors":[{"name":"Felix Becker","email":"felix.b@outlook.com"},{"name":"Andrew Carlson","email":"acarl005@g.ucla.edu"}],"bugs":{"url":"https://github.com/felixfbecker/cli-highlight/issues"},"license":"ISC","readmeFilename":"README.md"}