Back to Explore

fb55/domhandler

GitHub
1 watchersOpen source

Last release:

domhandler is a Node.js library that builds a DOM-like tree from HTML parsed by htmlparser2. It’s useful for turning raw HTML into structured nodes that can be manipulated with domutils or cheerio, and rendered using dom-serializer.

Project status

  • Actively maintained: Evidence suggests current activity, upstream push on 2026-06-09 and recent npm updates in 2026-03 (v6.0.0, v6.0.1), with the latest update only about 3 months before today (2026-06-11).
  • Update cadence: After a long quiet period (last prior update in 2022), updates returned with a tight pair in 2026-03-17 (v6.0.0 then v6.0.1), followed by a short gap with no newer updates recorded since v6.0.1 as of today.

AI summary generated

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • v6.0.1

    v6.0.1 primarily updates the release publishing process to include a JSR import map entry for `domelementtype`. The code diff shows no library source/API changes, but it does update package versioning metadata and dev tooling dependencies in the lockfiles.

  • v6.0.0

    v6.0.0 makes domhandler ESM-only, as stated in the release notes. The codebase also underwent a larger modernization pass (build output paths, tooling, and multiple dependency major upgrades), with some potentially breaking changes not fully called out in the release notes.

    Breaking
  • v5.0.3

    v5.0.3 primarily updates the TypeScript DOM node typing so that `Document` can be treated as a `ChildNode`. In the actual diff, there are also several undocumented repository-level changes (CI workflow actions, lint/format scripts) and significant devDependency bumps reflected in package.json and package-lock.json.

  • v5.0.2

    Release v5.0.2 makes a TypeScript typing fix for domhandler's `ChildNode` type. The code change narrows `ChildNode` into an explicit tagged union of specific node types.

    Breaking
  • v5.0.1

    v5.0.1 makes a targeted TypeScript typing fix for the `isComment` type guard. Runtime behavior appears unchanged, with only the return type annotation adjusted, plus normal package version bumps.

  • v5.0.0

    v5.0.0 removes the deprecated `normalizeWhitespace` option and refactors the DOM node model to use tagged unions. It also introduces an ESM build via package entry point changes. The main functional changes are centered on type model restructuring and removal of the whitespace normalization behavior.

    BreakingFeatures
  • v4.3.1

    v4.3.1 primarily adjusts TypeScript types for parse5 source code location information (node and element location fields). In addition, the repo updates CI workflow actions and bumps several devDependency versions, which show up in the lockfile but are not described in the release notes.

  • v4.3.0

    v4.3.0 extends domhandler's Node types with additional parse5-derived location and namespace metadata. The primary runtime change is that new properties can now be stored on nodes, and cloneNode will preserve them when present. The release notes only mention “missing Node properties from parse5” and docs, but the diff also includes cloning behavior updates and multiple dev/tooling dependency bumps.

    Features
  • v4.2.2

    v4.2.2 reverts a breaking change from v4.2.1 related to the deprecated `normalizeWhitespace` option. The code, tests, and README are updated to restore the option’s previous behavior when enabled.

  • v4.2.1

    v4.2.1 removes the deprecated `normalizeWhitespace` option (note says it should have been reverted in this release, and is re-added in v4.2.2). It also includes correctness fixes around node endIndex calculation for text handling and improves the `isText` type guard, plus added JSDoc descriptions for node classes.

    Breaking