micromark

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

Library
npm
v4.0.3
2,225 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 84
Community 48
Maturity 60
Momentum 40

Technical Analysis

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

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

TypeScript
82%
Other

AFFiNE

Collaboration · Note Taking · Productivity

73,040

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
TypeScript 82%
Rust 11%
Updated 6 days ago
TypeScript
96%
MIT

deepseek-harness

AI Agents · AI Development · Developer Tools

237,945

An open-source, plugin-based agent harness from DeepSeek AI that runs coding and automation agents across web, desktop, CLI, and SDK surfaces.

View details
81
Repo Health
89
Technical
74
Dependency
Built with
TypeScript 96%
Updated 6 days ago
TypeScript
96%
MIT

deepseek-harness

AI Agents · AI Development · Developer Tools

237,945

An open-source, plugin-based agent harness from DeepSeek AI that runs coding and automation agents across web, desktop, CLI, and SDK surfaces.

View details
81
Repo Health
89
Technical
74
Dependency
Built with
TypeScript 96%
Updated 6 days ago
TypeScript
96%
MIT

deepseek-harness

AI Agents · AI Development · Developer Tools

237,945

An open-source, plugin-based agent harness from DeepSeek AI that runs coding and automation agents across web, desktop, CLI, and SDK surfaces.

View details
81
Repo Health
89
Technical
74
Dependency
Built with
TypeScript 96%
Updated 6 days ago
TypeScript
96%
MIT

deepseek-harness

AI Agents · AI Development · Developer Tools

237,945

An open-source, plugin-based agent harness from DeepSeek AI that runs coding and automation agents across web, desktop, CLI, and SDK surfaces.

View details
81
Repo Health
89
Technical
74
Dependency
Built with
TypeScript 96%
Updated 6 days ago
Rust
47%
MIT

Kuku

Note Taking

225

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
52
Repo Health
67
Technical
67
Dependency
Built with
Rust 47%
TypeScript 40%
Updated 3 weeks ago
Rust
47%
MIT

Kuku

Note Taking

225

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
52
Repo Health
67
Technical
67
Dependency
Built with
Rust 47%
TypeScript 40%
Updated 3 weeks ago
Rust
56%
Apache 2.0

Magnitude

AI Development · Developer Tools

5,285

An open source inference engine that profiles your hardware, recommends the best local models, and tunes them for the coding agent you already use.

View details
78
Repo Health
83
Technical
71
Dependency
Built with
Rust 56%
TypeScript 18%
Python 11%
Updated 5 days ago
Go
60%
MIT

Obot

AI Agents · Mcp

1,071

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
87
Repo Health
70
Technical
70
Dependency
Built with
Go 60%
Svelte 26%
TypeScript 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