LinkeDOM

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

Library
npm
v0.18.13
2,068stars
ISC

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
52/100Fair
Development Activity44
Maintenance12
Community52
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
80/100Excellent
Architecture88
Code Quality78
Innovation80
Learning Curve72

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 12 apps in this directory

TypeScript
66%
Apache 2.0

Appsmith

Developer Tools · Automation · No Code Platforms

40,707

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

View details
94
Repo Health
79
Technical
68
Dependency
Built with
TypeScript66%
Java22%
Updated today
TypeScript
99%
MIT

defuddle

Developer Tools · Bookmarks Archiving

9,056

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

View details
82
Repo Health
73
Technical
81
Dependency
Built with
TypeScript99%
Updated 2 weeks ago
TypeScript
89%
Apache 2.0

HyperFrames

AI Development · AI Design Tools

41,625

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
82
Repo Health
83
Technical
65
Dependency
Built with
TypeScript89%
Updated today
TypeScript
98%
MIT

Kimi Code CLI

AI Code Assistants · AI Agents · Developer Tools

6,908

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
81
Repo Health
87
Technical
66
Dependency
Built with
TypeScript98%
Updated today
TypeScript
99%
Other

LobeHub

AI Assistants · Productivity · Automation

81,816

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
72
Dependency
Built with
TypeScript99%
Updated today
TypeScript
92%
Other

n8n

Automation · No Code Platforms

201,152

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
66
Dependency
Built with
TypeScript92%
Updated today
TypeScript
92%
Apache 2.0

Next AI Draw.io

Developer Tools · AI Design Tools · Design Tools

35,050

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

View details
83
Repo Health
80
Technical
72
Dependency
Built with
TypeScript92%
Updated today
TypeScript
85%
GPL 3.0

Notesnook

Note Taking · File Storage · Security

14,433

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

View details
91
Repo Health
84
Technical
66
Dependency
Built with
TypeScript85%
JavaScript12%
Updated today
TypeScript
27%
AGPL 3.0

Omnivore

Knowledge Management · Bookmarks Archiving · Note Taking

16,221

Self-hosted read-it-later platform with highlights, newsletters, PDFs, and seamless Obsidian and Logseq integration.

View details
78
Repo Health
74
Technical
66
Dependency
Built with
TypeScript27%
JavaScript24%
HTML19%
Updated 2 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

Search