{"id":28408799,"url":"https://github.com/code-hike/lighter","last_synced_at":"2025-06-30T04:32:33.060Z","repository":{"id":64887895,"uuid":"578660662","full_name":"code-hike/lighter","owner":"code-hike","description":"The syntax highlighter used by Code Hike.","archived":false,"fork":false,"pushed_at":"2024-12-31T17:55:46.000Z","size":6017,"stargazers_count":97,"open_issues_count":5,"forks_count":10,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-18T22:14:19.474Z","etag":null,"topics":["syntax-highlighting"],"latest_commit_sha":null,"homepage":"https://lighter-codehike.vercel.app","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/code-hike.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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},"funding":{"github":"code-hike","open_collective":"codehike"}},"created_at":"2022-12-15T15:24:36.000Z","updated_at":"2025-05-13T14:29:40.000Z","dependencies_parsed_at":"2023-09-29T08:50:28.091Z","dependency_job_id":"ca91f854-1876-4ca7-8f59-7e940f722852","html_url":"https://github.com/code-hike/lighter","commit_stats":{"total_commits":178,"total_committers":5,"mean_commits":35.6,"dds":0.2808988764044944,"last_synced_commit":"581b87f2c1e9d7aa2cd776cd48b5289ce392b286"},"previous_names":[],"tags_count":50,"template":false,"template_full_name":null,"purl":"pkg:github/code-hike/lighter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-hike%2Flighter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-hike%2Flighter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-hike%2Flighter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-hike%2Flighter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/code-hike","download_url":"https://codeload.github.com/code-hike/lighter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-hike%2Flighter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260908024,"owners_count":23080749,"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":["syntax-highlighting"],"created_at":"2025-06-02T04:37:42.999Z","updated_at":"2025-06-30T04:32:33.048Z","avatar_url":"https://github.com/code-hike.png","language":"JavaScript","funding_links":["https://github.com/sponsors/code-hike","https://opencollective.com/codehike"],"categories":[],"sub_categories":[],"readme":"The syntax highlighter used by Code Hike.\n\n## Usage\n\n```js\nimport { highlight } from \"@code-hike/lighter\";\n\nconst { lines, style } = await highlight(\n  /* code  */ \"print('hello')\",\n  /* lang  */ \"py\",\n  /* theme */ \"github-dark\"\n);\n\n// base foreground and background\nconst { color, background } = style;\n\nconsole.log(lines);\n```\n\nOutput:\n\n```json\n[\n  [\n    { \"style\": { \"color\": \"#79C0FF\" }, \"content\": \"print\" },\n    { \"style\": { \"color\": \"#C9D1D9\" }, \"content\": \"(\" },\n    { \"style\": { \"color\": \"#A5D6FF\" }, \"content\": \"'hello'\" },\n    { \"style\": { \"color\": \"#C9D1D9\" }, \"content\": \")\" }\n  ]\n]\n```\n\nFor **dark/light theme support with CSS** see [#25](https://github.com/code-hike/lighter/pull/25)\n\nFor more theme colors (like line number foreground, selection background, etc.):\n\n```js\nimport { getThemeColors } from \"@code-hike/lighter\";\n\nconst themeColors = await getThemeColors(\"material-darker\");\n```\n\n## Credits\n\n- Using [vscode-oniguruma](https://github.com/microsoft/vscode-oniguruma) for highlighting\n- **Heavily inspired by [Shiki](https://github.com/shikijs/shiki)** and adapted to Code Hike needs.\n- Some more inspiration from [starry-night](https://github.com/wooorm/starry-night)\n- Grammars and some themes come from [Shiki](https://github.com/shikijs/shiki), which pulls them from different sources.\n\n```\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode-hike%2Flighter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcode-hike%2Flighter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode-hike%2Flighter/lists"}