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:

RuntimeMinimum VersionStatus
Denov1.30+✅ Fully supported
Bunv1.0+✅ Fully supported
Node.jsv18+✅ 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.

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 PathDescription
dawmMain entry — re-exports everything
dawm/parseParsing functions (parseHTML, etc.)
dawm/domCore DOM classes (Document, Element)
dawm/collectionsCollection types (NodeList, etc.)
dawm/serializeSerialization (XMLSerializer, etc.)
dawm/selectCSS selector engine
dawm/guardsType guard utilities
dawm/optionsParse option types
dawm/typesTypeScript 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.