LinkeDOM

A fast, triple-linked-list DOM implementation for Node.js and Workers

Library
npm
v0.18.13
2,081 stars
ISC

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
50 /100 Fair
Development Activity 32
Maintenance 12
Community 56
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
80 /100 Excellent
Architecture 88
Code Quality 78
Innovation 80
Learning Curve 72

LinkeDOM is a DOM-like implementation designed for environments without a browser, such as Node.js, Deno, and Web/Service Workers. Instead of building the tree on arrays or object references the way JSDOM does, it links every node to its neighbors in a triple-linked list, which keeps mutations cheap and avoids the recursion-heavy operations that cause stack overflows or out-of-memory crashes on very large documents.

It exposes a DOMParser and a convenience parseHTML helper that return a close-to-standard document, window, and DOM classes (HTMLElement, Event, CustomEvent, and more) without polluting global scope, along with CSS-selector querying via css-select and an HTML/XML/SVG parser built on htmlparser2. It’s commonly reached for as a lighter, faster drop-in for JSDOM in server-side rendering, static site generation, HTML scraping/transformation, and testing scenarios where full browser-spec compliance isn’t required.

What You Get

  • A DOMParser/parseHTML API that parses HTML, XML, or SVG into a document with querySelector/querySelectorAll (CSS selectors via css-select)
  • Non-global DOM classes (HTMLElement, Event, CustomEvent, EventTarget, NodeList, NodeFilter) reachable via document.defaultView or the parseHTML return value
  • Working Custom Elements support, including connectedCallback and builtin-extends patterns
  • A linkedom/cached variant that memoizes childNodes/children/query results for read-heavy, rarely-mutated documents
  • A linkedom/worker export for Deno, Web Workers, and Service Workers that drops the optional canvas dependency
  • Fast structural JSON serialization/deserialization of whole documents via toJSON/parseJSON (backed by the JSDON format)

Common Use Cases

  • Server-side rendering and static site generation where a full JSDOM instance is too slow or memory-hungry
  • Scraping and transforming HTML/XML/SVG documents in a Node.js script or serverless function
  • Unit testing DOM-dependent code without spinning up a headless browser
  • Rendering or diffing large HTML documents (tens of thousands of nodes) where JSDOM’s array-based tree causes call-stack or memory errors

Under The Hood

Architecture — Parsing enters through esm/dom/parser.js’s DOMParser, which dispatches by MIME type to an HTMLDocument, SVGDocument, or XMLDocument (each in its own esm/html, esm/svg, esm/xml subtree) and hands markup to shared/parse-from-string.js, which streams tokens from htmlparser2 and builds nodes directly onto the triple-linked structure rather than an intermediate array-backed tree. Every node (esm/interface/node.js) carries direct pointers to its previous/next sibling and parent; elements (esm/interface/element.js) are represented as a linked start/end pair so a whole subtree can be excised or spliced by rewiring a handful of pointers instead of copying arrays. CSS-selector matching is delegated to the css-select package via shared/matches.js, and the top-level esm/index.js assembles the public surface (DOMParser, parseHTML, Document, event classes) without ever touching globalThis. A parallel linkedom/cached entry point wraps the same node classes with memoized childNodes/children/query caches for read-heavy workloads, and worker.js is a bundled, canvas-free build for Deno/Worker runtimes.

Tech Stack — Pure JavaScript (ESM, "type": "module" in package.json) with a generated CommonJS build (cjs/) produced via ascjs. Runtime dependencies are narrowly scoped: htmlparser2 for tokenizing HTML/XML, css-select for selector matching, cssom for inline style parsing, html-escaper and uhyphen for small serialization helpers. canvas is an optional peer dependency used only for <canvas> element support. Types are hand-authored under types/ (not the same install as source) and the build pipeline (tsc, rollup, ascjs) is orchestrated through npm scripts rather than a bundler config file. Requires Node.js >= 16.

Code Quality — The test suite (test/index.js) is substantial: it runs every module under test/xml, test/svg, test/html, test/interface, and test/shared twice — once against the standard build and once with global[Symbol.for('linkedom')] swapped to the cached variant — piped through c8 for coverage and eslint as a pre-test gate. There’s no assertion-library abstraction; tests use Node’s built-in assert, keeping the dependency surface minimal. Source files are small and single-purpose (most interface files are under 200 lines), naming closely mirrors the DOM spec (Node, Element, CharacterData), and JSDoc @implements/@typedef annotations back the hand-written .d.ts files instead of being TypeScript-authored directly.

API Design — The public API is intentionally small and spec-shaped: new DOMParser().parseFromString(html, mimeType) mirrors the browser standard, and parseHTML(html) is a documented shortcut that returns a pseudo-window object for callers who just want document/window without the two-step dance. Because classes are returned per-parse via defaultView rather than attached to globalThis, there’s a small extra step (destructure from the parse result) compared to JSDOM’s global-patching pattern, which the README explains explicitly with a function JSDOM(html) { return parseHTML(html); } drop-in shim. The README’s FAQ section proactively documents behavioral gaps (e.g., no live NodeList/HTMLCollection) so callers aren’t surprised by spec deviations.

Used by 14 apps in this directory

TypeScript
68%
Apache 2.0

Appsmith

Automation · Developer Tools · No Code Platforms

40,959

Open-source low-code platform to build admin panels, dashboards, and internal tools connected to any database or API.

View details
93
Repo Health
79
Technical
66
Dependency
Built with
TypeScript 68%
Java 21%
Updated 1 weeks ago
TypeScript
96%
MIT

defuddle

Bookmarks Archiving · Developer Tools

9,537

Extract clean article content and rich metadata from any web page, delivered as HTML or Markdown with zero clutter.

View details
84
Repo Health
73
Technical
81
Dependency
Built with
TypeScript 96%
Updated 5 days ago
TypeScript
87%
Apache 2.0

HyperFrames

AI Design Tools · AI Development

53,695

Turn plain HTML and CSS into deterministic, pixel-perfect MP4 videos — authored by humans or AI agents, rendered by headless Chrome and FFmpeg.

View details
84
Repo Health
83
Technical
65
Dependency
Built with
TypeScript 87%
JavaScript 12%
Updated 5 days ago
TypeScript
98%
MIT

Kimi Code CLI

AI Agents · AI Code Assistants · Developer Tools

7,705

A single-binary, terminal-native coding agent that reads, edits, and runs code end to end, built by Moonshot AI for Kimi models but pluggable with Anthropic, OpenAI, and Google providers too.

View details
82
Repo Health
87
Technical
67
Dependency
Built with
TypeScript 98%
Updated 5 days ago
TypeScript
99%
Other

LobeHub

AI Assistants · Automation · Productivity

82,864

Your Chief Agent Operator — build, schedule, and collaborate with an entire AI team in one self-hostable workspace.

View details
92
Repo Health
81
Technical
66
Dependency
Built with
TypeScript 99%
Updated 5 days ago
TypeScript
92%
Apache 2.0

Apache Maka

AI Agents · AI Development · Developer Tools

5,668

An Apache-incubated agent workspace that treats every model call, tool run, and permission decision as an append-only, replayable event log instead of disposable chat history.

View details
81
Repo Health
85
Technical
81
Dependency
Built with
TypeScript 92%
Updated 5 days ago
TypeScript
92%
Other

n8n

Automation · No Code Platforms

206,147

Code when you need it, UI when you don't — the workflow automation platform built for technical teams who refuse to choose.

View details
95
Repo Health
87
Technical
65
Dependency
Built with
TypeScript 92%
Updated 5 days ago
TypeScript
96%
Apache 2.0

Next AI Draw.io

AI Design Tools · Design Tools · Developer Tools

36,063

Turn natural language into professional draw.io diagrams with AI, cloud icons, and an MCP server for your IDE.

View details
78
Repo Health
80
Technical
68
Dependency
Built with
TypeScript 96%
Updated 6 days ago
TypeScript
85%
GPL 3.0

Notesnook

File Storage · Note Taking · Security

14,660

End-to-end encrypted, open-source note-taking where your data stays yours — even from the server.

View details
90
Repo Health
84
Technical
60
Dependency
Built with
TypeScript 85%
JavaScript 12%
Updated 6 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers