Installation
Detailed installation instructions for dawm across all supported runtimes and package managers.
Requirements
dawm requires a JavaScript runtime with WebAssembly support. The following runtimes are officially supported:
| Runtime | Minimum Version | Status |
|---|---|---|
| Deno | v1.30+ | ✅ Fully supported |
| Bun | v1.0+ | ✅ Fully supported |
| Node.js | v18+ | ✅ Fully supported |
| Cloudflare Workers | — | ✅ Fully supported |
Package Managers
npm
npm install dawm
pnpm
pnpm add dawm
Yarn
yarn add dawm
Bun
bun add dawm
Deno
Add dawm from npm:
deno add npm:dawm
Or use an import map in your deno.json:
{
"imports": {
"dawm": "npm:dawm"
}
}
CDN Usage
You can also use dawm directly from a CDN without installing it locally.
ES Module (recommended)
import * as dawm from "https://esm.sh/dawm?bundle&dts";
UMD / Script Tag
<script src="https://esm.sh/dawm/global?bundle"></script>
<script>
const doc = dawm.parseHTML("<h1>Hello from CDN!</h1>");
console.log(doc.body.firstElementChild.textContent);
</script>
JSR (Deno-native Registry)
dawm is also published on JSR:
deno add @nick/dawm
import { parseHTML } from "@nick/dawm";
Verifying Your Installation
After installing, you can verify everything works by running:
import { parseHTML } from "dawm";
const doc = parseHTML("<p>It works!</p>");
console.log(doc.body.firstElementChild?.textContent);
// Output: "It works!"
Submodule Imports
dawm provides scoped entry points for more granular imports:
| Import Path | Description |
|---|---|
dawm | Main entry — re-exports everything |
dawm/parse | Parsing functions (parseHTML, etc.) |
dawm/dom | Core DOM classes (Document, Element) |
dawm/collections | Collection types (NodeList, etc.) |
dawm/serialize | Serialization (XMLSerializer, etc.) |
dawm/select | CSS selector engine |
dawm/guards | Type guard utilities |
dawm/options | Parse option types |
dawm/types | TypeScript type definitions |
Troubleshooting
WebAssembly not supported
If you see an error about WebAssembly not being available, ensure your runtime supports it. Most modern runtimes do — check your runtime’s documentation for WASM support details.
Module resolution issues
If using TypeScript, ensure your tsconfig.json has moduleResolution set to
"bundler", "node16", or "nodenext" for proper subpath import resolution.