Prism

Lightweight, extensible syntax highlighting for the web and Node.js, with support for 300+ languages.

Library
npm
v1.30.0
13,043 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
78 /100 Good
Development Activity 80
Maintenance 56
Community 76
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
85 /100 Excellent
Architecture 85
Code Quality 85
Innovation 88
Learning Curve 85

Prism is a lightweight, robust, and elegant syntax highlighting library for the web. It tokenizes source code against grammar definitions and wraps each token in semantic markup, letting you style code with CSS themes rather than inline styles. Prism ships with definitions for hundreds of languages and a rich plugin ecosystem covering line numbers, copy-to-clipboard, autoloading, diff highlighting, and more.

Originally spun off from Lea Verou’s Dabblet, Prism runs in almost any browser and in Node.js. Its extensible, hook-based design lets you add languages, patch existing grammars, and hook into the highlighting lifecycle, which is why it powers documentation sites, blogs, and static site generators across the ecosystem.

What You Get

  • A tiny core tokenizer with grammar definitions for 300+ programming languages
  • A theme system driven entirely by CSS, with many bundled and community themes
  • A plugin ecosystem: line numbers, copy-to-clipboard, autoloader, diff highlighting, and more
  • First-class support for both browsers and Node.js via ESM and CommonJS builds
  • TypeScript type definitions and an extensible, hook-based highlighting lifecycle

Common Use Cases

  • Highlighting fenced code blocks on documentation sites and technical blogs
  • Rendering syntax-highlighted snippets in static site generators at build time
  • Displaying read-only code samples inside web apps and component libraries
  • Adding language-aware highlighting to Markdown/MDX pipelines

Under The Hood

Architecture - Prism’s core (src/core/) is a small tokenizer: tokenize/tokenize.js walks source text against a grammar object of named regex patterns, producing a doubly linked-list.js token stream that stringify.js renders into nested <span> markup with token-type classes. A registry.js manages language components by id, resolving aliases and lazily loading grammars so hundreds of languages need not all be present. highlight.js, highlight-element.js, and highlight-all.js are the public entry points, with auto-start.js wiring up automatic highlighting of the page. A hook system lets plugins observe and mutate the highlighting lifecycle. Tech Stack - Pure JavaScript authored as ESM in src/, with a custom scripts/build.js producing both the ESM (dist/) and CommonJS (dist/cjs/) builds plus generated TypeScript declarations (types/). It has zero runtime dependencies, targets Node.js >=18, and uses ESLint and Prettier for consistency. Code Quality - The repo carries 27 Mocha test files under tests/ covering the core, individual language definitions, plugins, regex patterns, and identifiers, alongside tsc typechecking of both source and tests. Source is thoroughly JSDoc-annotated (the Registry class documents every field and method), and a dedicated SECURITY.md describes how the maintainers triage ReDoS reports inherent to a regex-based highlighter. API Design - The public surface is deliberately minimal and ergonomic: Prism.highlight(code, grammar, language) for strings, highlightElement/highlightAll for the DOM, and declarative grammar objects plus a hook API for extension. Language grammars can be patched or extended without forking, and the extensive prismjs.com documentation and examples/ folder keep the getting-started boilerplate near zero.

Used by 42 apps in this directory

TypeScript
56%
Other

agenta

AI Development · Developer Tools · Devops

4,788

The open-source LLMOps platform unifying prompt engineering, evaluation, and observability for teams building reliable LLM applications.

View details
91
Repo Health
77
Technical
67
Dependency
Built with
TypeScript 56%
Python 39%
Updated 5 days ago
TypeScript
72%
AGPL 3.0

APITable

Databases · Low Code Platforms

15,623

API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.

View details
71
Repo Health
77
Technical
60
Dependency
Built with
TypeScript 72%
Java 22%
Updated 3 weeks ago
TypeScript
89%
Other

anytype-ts

Collaboration · Knowledge Management · Note Taking

8,861

A local-first, end-to-end encrypted knowledge OS that lets you build notes, tasks, wikis, and entire apps — with your data stored offline and synced peer-to-peer.

View details
88
Repo Health
78
Technical
67
Dependency
Built with
TypeScript 89%
Updated 1 weeks ago
TypeScript
68%
Apache 2.0

Appsmith

Automation · Developer Tools · No Code Platforms

40,959

Open-source low-code platform to build admin panels, dashboards, and internal tools connected to any database or API.

View details
93
Repo Health
79
Technical
66
Dependency
Built with
TypeScript 68%
Java 21%
Updated 6 days ago
Go
92%
AGPL 3.0

BillionMail

Marketing

15,695

Self-hosted email server and marketing platform that gives you unlimited sending, full deliverability control, and AI-assisted campaigns without monthly fees.

View details
52
Repo Health
74
Technical
70
Dependency
Built with
Go 92%
Updated 3 months ago
Java
48%
Apache 2.0

ClearFlask

Community · Product Management

451

Open-source feedback management and roadmap tool that lets product teams collect, prioritize, and respond to user input — with AI-powered summarization and full self-hosting control.

View details
83
Repo Health
73
Technical
62
Dependency
Built with
Java 48%
TypeScript 47%
Updated 6 days ago
Go
72%
Other

Convoy

Developer Tools · Devops

2,876

Convoy is an open-source, cloud-native webhooks gateway that ingests events over HTTP or straight from Kafka, SQS, Google Pub/Sub, and RabbitMQ, then reliably delivers them to subscriber endpoints with signed payloads, automatic retries, circuit breaking, and JavaScript-based transformations.

View details
89
Repo Health
81
Technical
65
Dependency
Built with
Go 72%
TypeScript 15%
HTML 12%
Updated 5 days ago
Go
49%
Other

Cosmos-Server

Authentication · Security

6,167

All-in-one self-hosted home server with SmartShield anti-DDoS, Nebula mesh VPN, automatic HTTPS, and a 250-app marketplace — all secured behind a unified auth layer.

View details
83
Repo Health
59
Technical
64
Dependency
Built with
Go 49%
JavaScript 48%
Updated 1 weeks ago
Python
58%
MIT

Docglow

Data Engineering

147

A next-generation documentation site generator for dbt Core projects — lineage explorer, health scoring, and full-text search for teams without access to dbt Cloud's built-in docs features.

View details
67
Repo Health
65
Technical
82
Dependency
Built with
Python 58%
TypeScript 42%
Updated 6 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers