cheeriojs/dom-serializer
Last release: 1 month ago
dom-serializer renders domhandler DOM nodes (or an array of them) to an HTML or XML string, similar to an outerHTML-style output. It is useful when you need to turn a parsed or programmatically built DOM back into serialized markup, with options to control entity encoding, attribute formatting, and self-closing tag behavior.
Project status
- Actively maintained, with a very recent upstream push on 2026-06-03 and continued versioned updates through v3.1.1.
- Apparent update cadence is relatively steady, v3.0.0 on 2026-03-17 followed by v3.1.0 and v3.1.1 on 2026-05-02, suggesting multiple updates within about 6 to 7 weeks, and another change shortly after.
AI summary generated Today
Recent updates
v3.1.1
1 month agov3.1.1 makes a small compatibility-focused change to attribute serialization. It updates the attribute iteration logic to avoid including inherited properties when formatting attributes.
v3.1.0
1 month agov3.1.0 focuses on faster DOM serialization, with an intended ~40% improvement. The release notes also mention documentation updates around the security caveat for `encodeEntities: false`, including a threat model style outline.
v3.0.0
2 months agov3.0.0 changes dom-serializer to be ESM only, and adds support for non-string attribute values by coercing them to strings before escaping. The codebase also reflects a broader modernization (tooling, build output, and major dependency upgrades) beyond what is stated in the release notes.
BreakingFeaturesv2.0.0
4/9/2022The provided code diff for v2.0.0 shows only version number updates in package.json and package-lock.json. No functional code changes, dependency updates, or build/output changes are present in the diff that would correspond to the release notes features and dependency bumps.
Featuresv1.4.1
4/9/2022v1.4.1 is a re-release of version 1.3.2. The release notes do not describe any functional, API, security, or performance changes, and direct users to the v1.4.0 release notes for the underlying explanation.
v1.4.0
4/9/2022v1.4.0 introduces a refactor of how DOM nodes are serialized, particularly around entity encoding, adding support for an `encodeEntities` option. The release notes are essentially only a warning about depending on `domhandler@5` types, while the code diff shows additional API surface and packaging changes. Significant behavior changes are present in attribute and text escaping logic, plus Node/packaging changes (ESM exports) that can break consumers.
BreakingFeaturesv1.3.2
5/17/2021v1.3.2 refactors dom-serializer to accept broader array-like inputs for the node(s) being serialized, and updates documentation/examples (notably aligning examples with selfClosingTags and adding domhandler references). The main functional change is in how the input is detected and iterated when it is a collection-like value.
Featuresv1.3.1
4/8/2021Release v1.3.1 is primarily a documentation update. It adds richer API documentation for `render` and `DomSerializerOptions`, including details and examples for options like `emptyAttrs`, `selfClosingTags`, and `xmlMode`, plus updates to the README and version metadata.
v1.3.0
4/8/2021v1.3.0 updates dom-serializer behavior around entity decoding/encoding, and adds test coverage for how entities are handled in special tags under different modes. It also upgrades dependencies used by the project.
Breakingv1.2.0
12/5/2020v1.2.0 updates dom-serializer to use an exhaustive switch over the ElementType enum, and adjusts CI to run tests on ppc64le. It also bumps several runtime dependencies (domhandler, domelementtype, entities).