LinkeDOM implements a DOM-shaped API for environments without a browser, using triple-linked lists for parsing and mutation performance.
Overview
LinkeDOM provides DOMParser-style HTML parsing and DOM manipulation for Node.js and other DOM-less runtimes. It prioritizes linear performance on large documents, limited recursion, and pragmatic rather than fully spec-complete browser behavior.
Documents come from DOMParser parseFromString or the parseHTML helper that exposes a pseudo window. Nodes can serialize to JSON via JSDON and be restored with parseJSON, with optional custom element handling through importNode or JSDON.fromJSON. Live collections are intentionally not supported; child lists are computed on demand unless you cache references yourself.
A linkedom/cached export caches query results for trees that change rarely, trading memory for faster repeated selectors. The module ships a CSS selector engine (CSSselect) and supports common node types including elements, text, comments, documents, fragments, and doctypes.
Project materials position it for server-side rendering and testing where JSDOM or basicHTML may be slower or heavier on very large HTML, while noting it is not aimed at full browser simulation.
Key features
- DOMParser and parseHTML entry points
- Triple-linked list node structure
- JSDON JSON serialization
- linkedom and linkedom/cached builds
- CSSselect-based queries
- Custom Elements import path
- Low live-collection overhead
Use cases
- Server-side HTML parsing
- SSR without a full browser
- Large document DOM edits
- Tests needing a lightweight DOM