Marked

A fast, low-level Markdown compiler that parses CommonMark and GFM into HTML in Node.js, browsers, or the CLI.

Library
npm
v18.0.14
37,214 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
94 /100 Excellent
Development Activity 96
Maintenance 96
Community 84
Maturity 60
Momentum 40

Technical Analysis

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

Marked is a low-level Markdown compiler built for speed rather than convenience. Instead of a single opinionated black box, it exposes its lexer, parser, and renderer as separate stages so you can override tokenization or output rendering without forking the library. It ships as a zero-dependency ESM/CJS/UMD package with full TypeScript types, a CLI binary, and conformance to the CommonMark and GitHub Flavored Markdown specifications.

Because Marked does no HTML sanitization by design, it is almost always paired with a sanitizer (DOMPurify, sanitize-html) when rendering untrusted input, which the project’s own README calls out explicitly as a security requirement rather than an afterthought.

What You Get

  • A synchronous or async marked.parse() function that compiles Markdown strings to HTML in one call
  • A pluggable extension system (marked.use()) for adding custom tokenizers, renderers, and walk-tokens hooks without patching core
  • First-class TypeScript definitions generated from the source, plus ESM, CJS, and UMD builds for Node.js, bundlers, and <script> tags
  • A marked CLI binary and man page for compiling Markdown from stdin or files on the command line
  • CommonMark and GitHub Flavored Markdown spec conformance, verified against the official test suites on every release

Common Use Cases

  • Rendering user-authored Markdown (comments, README previews, CMS content) to HTML before display
  • Powering static site generators and documentation tools that compile .md source files into pages
  • Building custom Markdown dialects or output formats (e.g. rendering to React elements or plain text) via custom renderers
  • Adding live Markdown preview panes in editors and note-taking apps

Under The Hood

Architecture - Marked’s pipeline is a clean three-stage compiler: src/Lexer.ts tokenizes raw Markdown into a TokensList using regex rule tables defined in src/rules.ts (separate block/inline rule sets), src/Tokenizer.ts implements the actual token-matching logic per Markdown construct (headings, lists, links, code fences, tables), and src/Parser.ts walks the resulting token tree and dispatches each node to src/Renderer.ts (or src/TextRenderer.ts for plain-text output). A stateful Marked class in src/Instance.ts wraps lexer, parser, tokenizer, renderer, and src/Hooks.ts together so that .use() extensions can override any single stage in isolation, and walkTokens() provides a generic tree-visitor for post-processing (e.g. rewriting links) without touching the core render path.

Tech Stack - The library is authored entirely in strict TypeScript (strict: true, verbatimModuleSyntax in tsconfig.json) with zero runtime dependencies, and built with esbuild (esbuild.config.js) into ESM, UMD, and CJS-compatible output plus a bundled .d.ts via dts-bundle-generator. Releases are automated through semantic-release with npm provenance enabled, and the package publishes a CLI binary (bin/marked.js) and man page (man/marked.1) alongside the library entry points.

Code Quality - The test suite spans roughly 4,600 lines across test/unit/*.test.js (Lexer, Parser, Hooks, instance, and CLI tests), plus a dedicated spec-conformance runner (test/run-spec-tests.js) that executes the official CommonMark and GFM fixture suites in test/specs. CI (test npm script) additionally runs UMD, CJS, and TypeScript-declaration smoke tests (test:umd, test:cjs, test:types) and ESLint via @markedjs/eslint-config on every change, so packaging regressions across module formats are caught before release, not just logic bugs.

API Design - The common case is a single call, marked.parse(markdown), with typed sync/async overloads controlled by an async option. Advanced customization goes through marked.use() with typed MarkedExtension objects that can supply custom tokenizers, renderers, or hooks, which keeps the 90% use case trivial while still exposing the full token model (src/Tokens.ts) for the minority of integrators who need to alter how specific Markdown constructs are parsed or rendered.

Used by 112 apps in this directory

Python
64%
Other

Onyx

AI Agents · AI Assistants · Knowledge Management

32,262

Self-hostable AI platform with agentic RAG, 50+ connectors, deep research, code execution, and support for every major LLM provider.

View details
92
Repo Health
83
Technical
68
Dependency
Built with
Python 64%
TypeScript 26%
Updated 1 weeks ago
Go
66%
Apache 2.0

open-code-review

Developer Tools · Devops

42,000

The AI code review agent born at Alibaba's scale — combining deterministic engineering with LLM intelligence for precise, token-efficient reviews.

View details
82
Repo Health
83
Technical
80
Dependency
Built with
Go 66%
JavaScript 13%
TypeScript 11%
Updated 2 weeks ago
TypeScript
97%
GPL 3.0

OpenKnowledge

Code Editors · Knowledge Management · Note Taking

4,337

A beautiful, local-first markdown IDE that turns any git repo into a live collaborative workspace for humans and AI coding agents like Claude, Codex, and OpenCode.

View details
79
Repo Health
89
Technical
64
Dependency
Built with
TypeScript 97%
Updated 1 weeks ago
Python
37%
Other

Open WebUI

AI Agents · AI Assistants

153,390

The extensible, privacy-first AI platform that runs Ollama, OpenAI, and any LLM backend behind a polished, feature-packed web interface.

View details
91
Repo Health
75
Technical
66
Dependency
Built with
Python 37%
Svelte 34%
JavaScript 21%
Updated 1 weeks ago
TypeScript
99%
Other

openclaude

AI Agents · AI Code Assistants

33,554

Run Claude Code workflows against any LLM — OpenAI, Gemini, Ollama, and 200+ backends — from a single terminal-first CLI.

View details
85
Repo Health
78
Technical
71
Dependency
Built with
TypeScript 99%
Updated 2 weeks ago
TypeScript
91%
MIT

OpenClaw

AI Agents · AI Assistants

390,670

An open-source AI assistant that runs on your own hardware and meets you in Discord, Slack, WhatsApp, iMessage, Telegram, and 20+ other channels, with native apps for every major platform.

View details
88
Repo Health
88
Technical
68
Dependency
Built with
TypeScript 91%
Updated 1 weeks ago
TypeScript
75%
MIT

OpenCode

AI Code Assistants

210,460

A fully open-source AI coding agent built for the terminal, with a TUI, desktop app, web client, plugin system, and SDK — one of the most-starred AI coding agents on GitHub.

View details
89
Repo Health
76
Technical
67
Dependency
Built with
TypeScript 75%
MDX 22%
Updated 1 weeks ago
TypeScript
38%
AGPL 3.0

OpenObserve

Analytics · Devops · Monitoring

22,161

Open source observability platform for logs, metrics, traces, and real user monitoring — delivering 140x lower storage costs than Elasticsearch with a single binary you can run in under 2 minutes.

View details
90
Repo Health
9
Technical
71
Dependency
Built with
TypeScript 38%
Rust 30%
Vue 18%
Updated 1 weeks ago
HTML
36%

OpenPanel

Devops · Hosting Control Panel

749

Docker-powered web hosting control panel that gives every user a fully isolated environment with dedicated web server, database, and networking — VPS-grade security on shared hardware.

View details
84
Repo Health
75
Technical
63
Dependency
Built with
HTML 36%
Go 32%
TypeScript 23%
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