dawm

Portable high-speed DOM parser for HTML/XML written in Rust, paired with TypeScript DOM APIs for any ES2015+ runtime with WebAssembly support.

⚡ Blazing Fast

Powered by a Rust-based HTML5 parser compiled to WebAssembly. Handles large documents with ease at near-native speed.

🧩 Familiar API

Standard DOM APIs you already know — Document, Element, querySelector, classList, and more.

📦 Zero Dependencies

No external packages required. Just dawm and your code. Lightweight and free of dependency conflicts.

🔒 Secure by Design

Runs in a WebAssembly sandbox. Scripts in parsed documents are never executed — safe for processing untrusted HTML.

🌍 Truly Portable

Works in Deno, Bun, Node.js, and Cloudflare Workers. Anywhere WebAssembly runs, dawm runs.

✅ Standards Compliant

Built on html5ever from the Servo project, implementing the WHATWG HTML parsing specification.

Quick Start

npm install dawm deno add npm:dawm bun add dawm
import { parseHTML } from "dawm";

const doc = parseHTML("<h1>Hello, world!</h1>");
console.log(doc.body.firstElementChild?.textContent);
// "Hello, world!"

Read the full guide →