micromark

The smallest 100% CommonMark-compliant markdown parser, with GFM and MDX support

Library
npm
v4.0.2
2,220stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
49/100Fair
Development Activity0
Maintenance48
Community48
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
76/100Good
Architecture82
Code Quality85
Innovation75
Learning Curve60

micromark is a markdown parser built to be small, fast, and fully compliant with the CommonMark spec, while also supporting GitHub Flavored Markdown, MDX, directives, frontmatter, and math as opt-in extensions. It parses markdown into a concrete token stream with positional information, then compiles that into HTML (or lets consumers plug in their own compiler), and is designed from the ground up to be safe against malicious input by default rather than requiring separate sanitization.

The project is a monorepo of ~20 packages under the micromark npm scope — the core micromark package plus factory and utility packages (micromark-factory-space, micromark-util-character, micromark-util-symbol, etc.) that its extensions and the wider ecosystem (including remark and mdast-util-from-markdown) depend on directly. It is maintained by Titus Wormer (wooorm) as the parsing engine underlying the unified/remark/rehype content-processing ecosystem.

What You Get

  • A 100% CommonMark-compliant parser with 100% GFM (tables, strikethrough, task lists, autolinks) support as an opt-in extension
  • MDX, directive, frontmatter, and math syntax extensions that plug into the same core tokenizer
  • Safe-by-default HTML output, resisting script injection and malformed input without requiring a separate sanitizer
  • A concrete token stream with full positional (line/column/offset) information, suitable for building custom syntax trees
  • A documented extension API (SyntaxExtension/HtmlExtension) for adding new markdown constructs
  • A companion micromark-build toolchain and shared micromark-util-*/micromark-factory-* packages reused across the ecosystem

Common Use Cases

  • Serving as the low-level parser underneath higher-level tools like remark, mdast-util-from-markdown, and static site generators that need markdown-to-HTML or markdown-to-AST conversion
  • Rendering user-generated markdown (comments, README previews, chat messages) safely without a separate XSS-sanitization pass
  • Building custom markdown dialects or editor tooling that needs positional token information for syntax highlighting or linting

Under The Hood

Architecture: micromark compiles markdown in four conceptual stages, described in its own README: preprocess (normalizing line endings and tabs), parse (a state-machine tokenizer producing events with syntax extensions plugged in), postprocess (resolving and subtokenizing constructs like emphasis that need lookahead), and compile (turning the event stream into HTML or another target via an HtmlExtension). The repo is a Yarn/npm workspaces monorepo (packages/) with the core micromark package depending on sibling packages (micromark-core-commonmark for CommonMark constructs, micromark-factory-* for reusable parsing routines, micromark-util-* for shared helpers like character classification and URI sanitization) rather than inlining that logic.

Tech Stack: Pure JavaScript (ESM-only, type: module), authored with JSDoc-based type annotations checked by TypeScript rather than being written in .ts directly, using Rollup for bundling and a custom micromark-build script. No runtime dependencies outside its own sibling packages plus small utilities (debug, decode-named-character-reference, devlop).

Code Quality: The README advertises roughly 2,000 tests with 100% coverage and fuzz testing, which is unusually rigorous for a markdown parser — a category where edge-case handling (nested emphasis, malformed HTML, unicode) is where most bugs live. Code style is enforced via xo (an ESLint preset) with Prettier. Recent commit activity has slowed relative to the project’s peak (health score flags low recent activity), which is typical for a spec-compliant parser that has reached feature completeness rather than a sign of abandonment.

API Design: The core micromark() function takes a markdown string and options (extensions, htmlExtensions) and returns an HTML string; a separate /stream export supports streaming input. Extensions follow a documented, consistent shape (SyntaxExtension for tokenizing new constructs, HtmlExtension for compiling them), which is what lets GFM, MDX, math, and frontmatter all plug into the same core without forking it. This extension-first design is the main reason downstream projects like remark build directly on micromark instead of writing their own parser.

Used by 12 apps in this directory

TypeScript
87%
Other

AFFiNE

Productivity · Project Management · Note Taking

72,238

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
67
Dependency
Built with
TypeScript87%
Updated yesterday
Rust
47%
MIT

Kuku

Note Taking

219

A local-first, open-source Markdown knowledge workspace for macOS — plain files, personal wiki and Second Brain workflows, AI-assisted diffs, and encrypted sync, built as an Obsidian alternative.

View details
81
Repo Health
67
Technical
67
Dependency
Built with
Rust47%
TypeScript40%
Updated yesterday
Rust
47%
MIT

Kuku

Note Taking

219

A local-first, open-source Markdown knowledge workspace for macOS — plain files, personal wiki and Second Brain workflows, AI-assisted diffs, and encrypted sync, built as an Obsidian alternative.

View details
81
Repo Health
67
Technical
67
Dependency
Built with
Rust47%
TypeScript40%
Updated yesterday
Go
61%
MIT

Obot

AI Agents

985

An open-source MCP platform for organizations — host MCP servers, run MCP registries, monitor usage, and build agents and chatbots on top of the Model Context Protocol from one self-hosted deployment.

View details
85
Repo Health
70
Technical
70
Dependency
Built with
Go61%
Svelte29%
Updated 3 days ago
TypeScript
67%
Apache 2.0

open-design

Design Tools

94,473

Local-first, open-source Claude Design alternative that turns your existing coding agent CLI into a full agentic design studio — with 259+ skills, 142+ design systems, and sandboxed artifact delivery across web, desktop, and mobile surfaces.

View details
85
Repo Health
86
Technical
72
Dependency
Built with
TypeScript67%
HTML25%
Updated yesterday
JavaScript
63%
AGPL 3.0

overleaf

Collaboration · Productivity

18,090

Open-source, real-time collaborative LaTeX editor with sandboxed compilation and full TeXLive support for self-hosted academic and research teams.

View details
82
Repo Health
80
Technical
62
Dependency
Built with
JavaScript63%
TypeScript29%
Updated 1 months ago
TypeScript
98%
Apache 2.0

TinaCMS

CMS

13,780

An open-source, Git-backed headless CMS that gives editors a live visual editing UI over Markdown, MDX, JSON, and YAML content while developers keep everything in version control.

View details
92
Repo Health
74
Technical
59
Dependency
Built with
TypeScript98%
Updated today
TypeScript
98%
Apache 2.0

TinaCMS

CMS

13,780

An open-source, Git-backed headless CMS that gives editors a live visual editing UI over Markdown, MDX, JSON, and YAML content while developers keep everything in version control.

View details
92
Repo Health
74
Technical
59
Dependency
Built with
TypeScript98%
Updated today
TypeScript
98%
Apache 2.0

TinaCMS

CMS

13,780

An open-source, Git-backed headless CMS that gives editors a live visual editing UI over Markdown, MDX, JSON, and YAML content while developers keep everything in version control.

View details
92
Repo Health
74
Technical
59
Dependency
Built with
TypeScript98%
Updated today

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