# What changed in domhandler

> 13 changes in domhandler 3 to 6 from its official release notes, upgrade guides and advisories: 6 breaking, 3 new APIs and options. Each one cited. Sources checked 2026-10-23. HTML: https://unstale.sh/npm/domhandler/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## domhandler 6

### Breaking changes

- domhandler is now ESM-only, so CommonJS usage is no longer supported. (6.0.0) — [release notes](https://github.com/fb55/domhandler/releases/tag/v6.0.0)

### Tooling

- A JSR import map was added for domelementtype. (6.0.1) — [release notes](https://github.com/fb55/domhandler/releases/tag/v6.0.1)

## domhandler 5

### Breaking changes

- Nodes now use tagged unions for node types, which might break some TypeScript code. (5.0.0) — [release notes](https://github.com/fb55/domhandler/releases/tag/v5.0.0)
- The deprecated normalizeWhitespace option was removed. (5.0.0) — [release notes](https://github.com/fb55/domhandler/releases/tag/v5.0.0)

### New APIs and options

- An ESM build was added. (5.0.0) — [release notes](https://github.com/fb55/domhandler/releases/tag/v5.0.0)

## domhandler 4

### Breaking changes

- Removes underscores from private property names, which might break code using those properties, such as in a custom handler. (4.0.0) — [release notes](https://github.com/fb55/domhandler/releases/tag/v4.0.0)
- Adds a root element to the tree; some nodes now have a parent node where they did not before. (4.0.0) — [release notes](https://github.com/fb55/domhandler/releases/tag/v4.0.0)

### New APIs and options

- Adds a dedicated Document class. (4.0.0) — [release notes](https://github.com/fb55/domhandler/releases/tag/v4.0.0)

### Behavior and default changes

- Adds support for parse5 DOM extensions in the types and in cloneNode. (4.0.0) — [release notes](https://github.com/fb55/domhandler/releases/tag/v4.0.0)

### Fixes and other changes

- Clones indices as well. (4.0.0) — [release notes](https://github.com/fb55/domhandler/releases/tag/v4.0.0)

## domhandler 3

### Breaking changes

- The withDomLvl1 option was removed; DOM level 1 properties are now added by default through backing classes for the node types. (3.0.0) — [release notes](https://github.com/fb55/domhandler/releases/tag/v3.0.0)

### New APIs and options

- Three different types of nodes now have backing classes that add all previously available DOM level 1 properties by default. (3.0.0) — [release notes](https://github.com/fb55/domhandler/releases/tag/v3.0.0)

### Behavior and default changes

- Exports changed slightly. (3.0.0) — [release notes](https://github.com/fb55/domhandler/releases/tag/v3.0.0)
