Skip to content
@codelightjs

Codelight.js

Syntax highlighting that keeps up with live code. Each line highlighted once, no flicker, no dependencies.

codelight.js

Syntax highlighting that keeps up with live code.
Very fast and lightweight. Each line is highlighted once, and only the line being written gets updated, so it stays fast even when the code is long. No flicker, no dependencies.

Live demo Β· GitHub Β· npm Β· Docs

A TypeScript code block being highlighted line by line as it arrives

Try it

On any page, no build step:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/codelight.js/build/styles/default.min.css">
<script src="https://cdn.jsdelivr.net/npm/codelight.js/build/codelight.min.js"></script>
<script>codelight.highlightAll();</script>

For live code, write each chunk as it arrives:

const view = codelight.mount(codeElement, { lang: "python" });
view.write(chunk);

In React: npm install codelight.js, then <CodeLight code={reply} lang="ts" />.

Why codelight.js

⚑ Keeps up with live code Each update costs one short line of work, however long the code already is.
🧩 Half-finished Markdown Finds code blocks in Markdown that's still arriving, including unclosed fences.
πŸ“¦ 8.4 KB, no dependencies All 19 languages in one file.
πŸŒ— Light and dark themes Every colour is a CSS variable and meets WCAG AA contrast.
πŸ”Œ Works anywhere A script tag, any bundler, or React with server rendering.

Repositories

Repo What it is
codelight.js The library: source, docs, tests and releases
codelightjs.github.io The website and live demo

MIT licensed. Built by CK Giri.

Popular repositories Loading

  1. codelight.js codelight.js Public

    Syntax highlighting that keeps up with live code. Each line highlighted once, no flicker, no dependencies. 19 languages, React or a script tag.

    TypeScript 1 1

  2. codelightjs.github.io codelightjs.github.io Public

    Website and live demo for codelight.js.

    HTML

  3. .github .github Public

Repositories

Showing 3 of 3 repositories
  • codelight.js Public

    Syntax highlighting that keeps up with live code. Each line highlighted once, no flicker, no dependencies. 19 languages, React or a script tag.

    codelightjs/codelight.js's past year of commit activity
    TypeScript 1 MIT 1 0 0 Updated Nov 29, 2026
  • .github Public
    codelightjs/.github's past year of commit activity
    0 0 0 0 Updated Nov 29, 2026
  • codelightjs.github.io Public

    Website and live demo for codelight.js.

    codelightjs/codelightjs.github.io's past year of commit activity
    HTML 0 0 0 0 Updated Nov 29, 2026