Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
M

markdown-wasm

> 编程语言
Open source

Very fast Markdown parser and HTML generator implemented in WebAssembly, based on md4c

1.7K stars0 likes1 views
WebsiteGitHub

About

Very fast Markdown parser and HTML generator implemented in WebAssembly, based on md4c

markdown-wasm

Very fast Markdown parser & HTML renderer implemented in WebAssembly

  • Zero dependencies (31 kB gzipped)
  • Portable & safe (WASM executes in isolated memory and can run almost anywhere)
  • Simple API
  • Very fast
  • Based on md4c — compliant to the CommonMark specification

Examples

In NodeJS, single file with embedded compressed WASM

javascript
const markdown = require("./dist/markdown.node.js")
console.log(markdown.parse("# hello\n*world*"))

ES module with WASM loaded separately

javascript
import * as markdown from "./dist/markdown.es.js"
await markdown.ready
console.log(markdown.parse("# hello\n*world*"))

Web browser

xml
<script src="markdown.js"></script>
<script>
window["markdown"].ready.then(markdown => {
  console.log(markdown.parse("# hello\n*world*"))
})
</script>

Install

bash
npm install markdown-wasm

Benchmarks

The test/benchmark directory contain a benchmark suite which you can run yourself. It tests a few popular markdown parser-renderers by parsing & rendering a bunch of different sample markdown files.

The following results were samples on a 2.9 GHz MacBook running macOS 10.15, NodeJS v14.11.0

Average ops/second

Ops/second represents how many times a library is able to parse markdown and render HTML during a second, on average across all sample files.

Average throughput

Throughput is the average amount of markdown data processed during a second while both parsing and rendering to HTML. The statistics does not include HTML generated but only bytes of markdown source text parsed.

Min–max parse time

This graph shows the spread between the fastest and slowest parse-and-render operations for each library. Lower numbers are better.

See test/benchmark for more information.

API

…

See markdown.d.ts

Building from source

bash
npm install
npx wasmc

Build debug version of markdown into ./build/debug and watch source files:

bash
npx wasmc -g -w

If you need special builds, like for example an ES module with embedded WASM, edit the wasmc.js file and add module({...}) directives.

Example:

javascript
module({ ...m,
  name:   "markdown-custom",
  out:    outdir + "/markdown.custom.js",
  embed:  true,
  format: "es",
})

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Cmarkdownparserwasmwebassembly

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言