Prism

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

Library
npm
v1.30.0
13,051 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
83 /100 Excellent
Development Activity 88
Maintenance 68
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
47%
AGPL 3.0

Grafana

Analytics · Monitoring

77,469

The open-source observability platform that unifies metrics, logs, and traces from any data source into dynamic, queryable dashboards.

View details
95
Repo Health
91
Technical
63
Dependency
Built with
TypeScript 47%
Go 47%
Updated 6 days ago
TypeScript
91%
Apache 2.0

Helicone

AI Development · Analytics · Monitoring

6,235

An open-source AI gateway and LLM observability platform that routes requests to 100+ models while logging cost, latency, and full traces for every call.

View details
74
Repo Health
81
Technical
65
Dependency
Built with
TypeScript 91%
Updated 6 days ago
TypeScript
66%
MIT

Jitsu

Data Engineering

5,110

Open-source, fully-scriptable data ingestion engine that streams events from web, apps, and APIs to any data warehouse in real time.

View details
89
Repo Health
79
Technical
66
Dependency
Built with
TypeScript 66%
Go 32%
Updated 1 weeks ago
Go
51%
AGPL 3.0

listmonk

Blogging · Marketing

23,944

High-performance, self-hosted newsletter and mailing list manager packaged as a single binary with built-in analytics, transactional messaging, and multi-channel delivery.

View details
90
Repo Health
74
Technical
64
Dependency
Built with
Go 51%
JavaScript 22%
HTML 20%
Updated 6 days ago
TypeScript
44%
Other

Magic

AI Agents · Automation · Low Code Platforms

5,055

Magic is an enterprise-grade open-source AI agent platform combining a generalist AI agent, workflow engine, IM, and collaborative office system for running an AI-powered digital workforce.

View details
68
Repo Health
79
Technical
65
Dependency
Built with
TypeScript 44%
PHP 32%
Updated 2 months ago
TypeScript
87%
MIT

medusa

Ecommerce

36,897

The most flexible open-source commerce platform — build B2C, B2B, and marketplace applications with modular, composable commerce primitives.

View details
94
Repo Health
87
Technical
63
Dependency
Built with
TypeScript 87%
JavaScript 12%
Updated 1 weeks ago
TypeScript
85%
GPL 3.0

Notesnook

File Storage · Note Taking · Security

14,822

End-to-end encrypted, open-source note-taking where your data stays yours — even from the server.

View details
91
Repo Health
84
Technical
60
Dependency
Built with
TypeScript 85%
JavaScript 12%
Updated 6 days ago
TypeScript
90%
MIT

open-pencil

AI Design Tools · Design Tools

9,227

An open-source design editor that reads native Figma files, ships a built-in AI assistant with 100+ design tools, and offers real-time serverless collaboration — all without giving up your files.

View details
84
Repo Health
78
Technical
69
Dependency
Built with
TypeScript 90%
Updated 1 weeks ago
TypeScript
54%
Other

OpenReplay

Analytics

13,042

Self-hosted session replay and product analytics suite that lets you see exactly what users do on your web app — without sending data to third parties.

View details
91
Repo Health
77
Technical
66
Dependency
Built with
TypeScript 54%
Go 13%
Updated 1 weeks 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