About dawm

Learn about the dawm project — its purpose, architecture, and the team behind it.


What is dawm?

dawm is a headless DOM toolkit for parsing, traversing, manipulating, and serializing HTML/SVG/XML documents in server-side, serverless, and edge compute environments.

Its hybrid architecture couples a high-speed parser written in Rust — compiled to WebAssembly — with TypeScript implementations of the standard Document Object Model (DOM) APIs.

Why dawm?

Traditional server-side DOM solutions like JSDOM are powerful but heavyweight. They bundle a full browser simulation, resulting in slow startup times and large memory footprints. Other solutions sacrifice API familiarity for performance.

dawm bridges this gap:

Architecture

┌──────────────────────────────────────────────────┐
│                 TypeScript Layer                  │
│  Document · Element · NodeList · DOMParser · ...│
├──────────────────────────────────────────────────┤
│               WebAssembly Bridge                 │
│          Tree structure & parse results           │
├──────────────────────────────────────────────────┤
│                  Rust Core                       │
│     html5ever parser · XML parser · Selector     │
└──────────────────────────────────────────────────┘
  1. Rust Core — Built on the html5ever crate from the Servo project, providing a fully standards-compliant HTML5 parsing algorithm. Compiled to WebAssembly for portability.

  2. WebAssembly Bridge — Serializes parse results into an efficient wire format that the TypeScript layer deserializes into a full DOM tree.

  3. TypeScript Layer — Implements familiar DOM APIs (Document, Element, querySelector, classList, etc.) that operate on the parsed tree structure.

Standards Compliance

The parser is built on html5ever, which implements the WHATWG HTML parsing specification. This means dawm handles the same edge cases, error recovery, and quirks that real browsers do.

Security

dawm runs all parsing in a WebAssembly sandbox. Scripts in parsed documents are never executed — they are automatically stripped. This makes dawm safe for processing untrusted HTML content.

Project Status

dawm is under active development. The core parsing and DOM API surface is stable and ready for production use. See the Roadmap for upcoming features.

License

dawm is dual-licensed under MIT and Apache-2.0. Use whichever works best for your project.

Author

Created by Nicholas Berlette.