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.10
37,062stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
93/100Excellent
Development Activity100
Maintenance96
Community76
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
87/100Excellent
Architecture90
Code Quality92
Innovation85
Learning Curve82

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 108 apps in this directory

TypeScript
99%
Other

Activepieces

Automation · AI Assistants

23,887

Open-source AI automation platform that converts 280+ workflow integrations into MCP servers for LLMs, with no-code builders and TypeScript extensibility.

View details
92
Repo Health
85
Technical
65
Dependency
Built with
TypeScript99%
Updated today
TypeScript
88%
Other

AFFiNE

Productivity · Project Management · Note Taking

71,668

Write, draw, and plan in one infinite canvas — the open-source alternative to Notion and Miro that keeps your data yours.

View details
91
Repo Health
87
Technical
68
Dependency
Built with
TypeScript88%
Updated today
TypeScript
59%
Other

agenta

Developer Tools · Devops · AI Development

4,489

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
TypeScript59%
Python39%
Updated today
TypeScript
72%
AGPL 3.0

APITable

Low Code Platforms · Databases

15,526

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

View details
53
Repo Health
77
Technical
60
Dependency
Built with
TypeScript72%
Java22%
Updated 9 months ago
JavaScript
95%
MIT

AnythingLLM

Developer Tools · Automation · AI Assistants

64,914

The all-in-one AI platform for private document chat, no-code agents, and local LLMs with zero setup friction.

View details
91
Repo Health
78
Technical
68
Dependency
Built with
JavaScript95%
Updated today
Go
60%
Apache 2.0

Apache Answer

Community

15,652

Open-source Q&A platform for communities, help centers, and knowledge bases with AI assistant and plugin extensibility

View details
85
Repo Health
78
Technical
69
Dependency
Built with
Go60%
TypeScript36%
Updated 2 days ago
Python
59%
Apache 2.0

argilla

AI Development · Data Engineering

5,081

Collaborate on high-quality AI training data with a self-hosted annotation platform built for LLMs, NLP, and multimodal models.

View details
65
Repo Health
81
Technical
63
Dependency
Built with
Python59%
Jupyter Notebook21%
Updated 2 days ago
Go
92%
AGPL 3.0

BillionMail

Marketing

15,424

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

View details
59
Repo Health
74
Technical
73
Dependency
Built with
Go92%
Updated 2 months ago
TypeScript
100%
MIT

Botpress

AI Assistants · AI Development · Customer Support

14,872

The open-source hub for building and deploying LLM-powered AI agents with TypeScript-first tooling, 40+ integrations, and a revolutionary code-execution agent framework.

View details
95
Repo Health
82
Technical
66
Dependency
Built with
TypeScript100%
Updated yesterday

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

Search