Getting Started

Learn how to install and start using dawm in your project.


What is dawm?

dawm is a portable, high-speed DOM parser for HTML and XML, built with a Rust-powered WebAssembly core paired with familiar TypeScript DOM APIs. It runs in any ES2015+ JavaScript runtime that supports WebAssembly — including Deno, Bun, Node.js, and Cloudflare Workers.

Whether you’re building an SSR framework, a web scraper, or running DOM-based unit tests without a full browser, dawm provides a fast, secure, and standards-compliant solution.

Installation

Deno

deno add npm:dawm

Or import directly from esm.sh:

import { parseHTML } from "https://esm.sh/dawm?bundle&dts";

Node.js

npm install dawm

pnpm

pnpm add dawm

Yarn

yarn add dawm

Bun

bun add dawm

Quick Start

import { parseHTML } from "dawm";

const doc = parseHTML(
  "<!doctype html><html><body><h1>Hello, world!</h1></body></html>"
);

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

What’s Next?