# domutils

> Utilities for working with htmlparser2's dom

Latest version **4.0.2** (published 2026-03-18) · BSD-2-Clause license · 0 weekly downloads

## Install

```sh
npm install domutils
pnpm add domutils
yarn add domutils
bun add domutils
```

## Health

**Score 70/100 (B)** — status: stable.

Positive: has types; esm support; no vulnerabilities; has provenance; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 4.0.2 |
| Published | 2026-03-18 |
| First published | 2012-11-10 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=20.19.0 |
| Dependencies | 3 |
| Unpacked size | 116.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 228 |
| Author | Felix Boehm |
| Maintainers | fb55 |
| Keywords | dom, htmlparser2 |

## Links

- npm: https://www.npmjs.com/package/domutils
- Repository: https://github.com/fb55/domutils
- Homepage: https://github.com/fb55/domutils#readme
- Issues: https://github.com/fb55/domutils/issues
- Funding: https://github.com/fb55/domutils?sponsor=1
- npm.io page: https://npm.io/package/domutils

## Dependencies (3)

- [domhandler](https://npm.io/package/domhandler.md) ^6.0.0
- [dom-serializer](https://npm.io/package/dom-serializer.md) ^3.0.0
- [domelementtype](https://npm.io/package/domelementtype.md) ^3.0.0

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 4.0.2 (latest) — 2026-03-18
- 4.0.1 — 2026-03-17
- 4.0.0 — 2026-03-17
- 3.2.2 — 2025-01-06
- 3.2.1 — 2024-12-24
- 3.2.0 — 2024-12-24
- 3.1.0 — 2023-04-29
- 3.0.1 — 2022-04-22
- 3.0.0 — 2022-04-21
- 2.8.0 — 2021-08-27
- 2.7.0 — 2021-06-06
- 2.6.0 — 2021-04-16
- 2.5.2 — 2021-04-08
- 2.5.1 — 2021-04-01
- 2.5.0 — 2021-03-10
- … 31 more at https://npm.io/package/domutils/versions

## README

# domutils [![Node.js CI](https://github.com/fb55/domutils/actions/workflows/nodejs-test.yml/badge.svg)](https://github.com/fb55/domutils/actions/workflows/nodejs-test.yml)

Utilities for working with [htmlparser2](https://github.com/fb55/htmlparser2)'s DOM.

All functions are exported as a single module. Look [through the docs](https://domutils.js.org/modules.html) to see what is available.

## Ecosystem

| Name                                                          | Description                                             |
| ------------------------------------------------------------- | ------------------------------------------------------- |
| [htmlparser2](https://github.com/fb55/htmlparser2)            | Fast & forgiving HTML/XML parser                        |
| [domhandler](https://github.com/fb55/domhandler)              | Handler for htmlparser2 that turns documents into a DOM |
| [domutils](https://github.com/fb55/domutils)                  | Utilities for working with domhandler's DOM             |
| [css-select](https://github.com/fb55/css-select)              | CSS selector engine, compatible with domhandler's DOM   |
| [cheerio](https://github.com/cheeriojs/cheerio)               | The jQuery API for domhandler's DOM                     |
| [dom-serializer](https://github.com/cheeriojs/dom-serializer) | Serializer for domhandler's DOM                         |

---

License: BSD-2-Clause

## Security contact information

To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security).
Tidelift will coordinate the fix and disclosure.

---
_Source: https://npm.io/package/domutils · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
