jsdom

A pure-JavaScript implementation of the WHATWG DOM and HTML standards for Node.js.

Library
npm
v30.0.1
21,651stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
92/100Excellent
Development Activity96
Maintenance96
Community76
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
87/100Excellent
Architecture89
Code Quality86
Innovation88
Learning Curve78

jsdom is a pure-JavaScript implementation of many web standards, most notably the WHATWG DOM and HTML specifications, built to run inside Node.js. It emulates enough of a browser environment to parse HTML into a live document, expose the familiar window and document globals, run scripts, handle events, and fetch subresources, without needing an actual browser or headless Chromium.

It is the DOM engine behind much of the JavaScript testing ecosystem and a workhorse for server-side HTML processing and scraping. You give the JSDOM constructor a string of markup and get back a fully navigable document you can query with standard DOM APIs, manipulate, and serialize back to HTML.

What You Get

  • A JSDOM constructor that parses HTML or XML into a live, spec-compliant window/document pair
  • Standard DOM APIs, including querySelector, events, mutation observers, ranges, and node traversal
  • Configurable script execution, subresource loading, cookies, virtual console, and custom resource loaders
  • Convenience factories such as JSDOM.fromFile() and JSDOM.fromURL() plus serialization back to HTML

Common Use Cases

  • Providing the DOM environment for unit tests run under Jest, Vitest, or Mocha
  • Server-side scraping and extraction of data from real-world HTML pages
  • Rendering, inspecting, or transforming HTML documents in Node.js pipelines

Under The Hood

Architecture - The public surface lives in lib/api.js, whose JSDOM class normalizes the input HTML, transforms user options, builds a window via createWindow (lib/jsdom/browser/Window.js), and parses markup into a document with parseIntoDocument before closing it. The bulk of the implementation is the lib/jsdom/living/ tree, roughly 35 modules mapping to web-standard areas such as nodes, events, xhr, fetch, css, webstorage, range, custom-elements, and mutation-observer, with IDL interfaces generated from Web IDL. Convenience factories (fromFile, fromURL), a VirtualConsole, a loose CookieJar, and a pluggable resource/dispatcher layer round out the design.

Tech Stack - jsdom is written in JavaScript using CommonJS modules and targets modern Node.js (engines ^20.19 || ^22.13 || >=24). It composes a suite of standards-focused dependencies: parse5 for HTML parsing, saxes and xml-name-validator for XML, whatwg-url and whatwg-mimetype for URL/MIME handling, undici for fetch, tough-cookie for cookies, css-tree/@asamuzakjp packages for CSS, and webidl-conversions/decimal.js for type coercion. Interface bindings are generated with webidl2js, and the build is orchestrated with wireit.

Code Quality - The project is mature and rigorously tested. Beyond its own test/api suite run with Mocha, it validates conformance against the shared Web Platform Tests (test/web-platform-tests), a strong signal of standards fidelity. It ships an ESLint flat config, contributor and maintainer guides, and benchmarks. The codebase is large but consistently organized by specification area, and error handling follows DOM semantics (e.g. throwing DOMException on quota or parse violations).

API Design - The developer experience is deliberately browser-like: import jsdom, destructure JSDOM, and pass a markup string to get a working window/document. A single options object exposes advanced behavior (url, runScripts, resources, includeNodeLocations, storageQuota) with safe, performance-minded defaults, and static async factories cover file and URL sources. Named exports (JSDOM, VirtualConsole, CookieJar, ResourceLoader) and thorough README documentation keep the boilerplate minimal for common cases while leaving escape hatches for advanced use.

Used by 185 apps in this directory

TypeScript
76%
AGPL 3.0

Abby

Developer Tools · Product Management

167

Statically typed feature flags, remote config, and A/B testing with framework-native SDKs for TypeScript teams.

View details
30
Repo Health
70
Technical
63
Dependency
Built with
TypeScript76%
MDX18%
Updated 1 years ago
TypeScript
99%
Other

Activepieces

Automation · AI Assistants

23,887

Open-source AI automation platform that converts 280+ workflow integrations into MCP servers for LLMs, with no-code builders and TypeScript extensibility.

View details
92
Repo Health
85
Technical
65
Dependency
Built with
TypeScript99%
Updated today
TypeScript
94%
MIT

Actual

Invoicing Finance

28,224

Local-first personal finance with envelope budgeting, end-to-end encryption, and multi-device sync — no subscription required.

View details
93
Repo Health
85
Technical
77
Dependency
Built with
TypeScript94%
Updated yesterday
Python
99%
MIT

Agent Lightning

AI Development

17,500

A Microsoft-built training framework that optimizes AI agents with reinforcement learning, automatic prompt optimization, or supervised fine-tuning — with near-zero code changes to your existing agent, in any framework.

View details
84
Repo Health
68
Technical
69
Dependency
Built with
Python99%
Updated today
TypeScript
86%
MIT

Agents Observe

Developer Tools

652

A real-time, fully local observability dashboard for Claude Code and Codex agent sessions — filtering, search, session replay, and token/cost breakdowns via an auto-starting MCP server.

View details
71
Repo Health
67
Technical
77
Dependency
Built with
TypeScript86%
JavaScript11%
Updated 4 weeks ago
TypeScript
91%
MIT

AI Engineer Coach

Developer Tools

3,614

A VS Code extension that reads your local AI coding session logs and turns them into actionable insights — anti-pattern detection across 45 rules, output tracking by model and harness, and skill discovery, with no data leaving your machine.

View details
69
Repo Health
70
Technical
85
Dependency
Built with
TypeScript91%
Updated today
TypeScript
95%
Apache 2.0

AionUi

AI Agents · Productivity

32,102

Free, open-source Cowork desktop app that unifies Claude Code, Codex, Gemini CLI, and 20+ AI agents into a single platform with multi-agent teams, 24/7 cron automation, and zero-config built-in agent.

View details
88
Repo Health
76
Technical
66
Dependency
Built with
TypeScript95%
Updated today
TypeScript
72%
AGPL 3.0

APITable

Low Code Platforms · Databases

15,526

API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.

View details
53
Repo Health
77
Technical
60
Dependency
Built with
TypeScript72%
Java22%
Updated 9 months ago
TypeScript
84%
MIT

Amical

Note Taking · AI Assistants

1,495

Local-first AI dictation that understands your active app — private, offline, and built for speed.

View details
79
Repo Health
82
Technical
67
Dependency
Built with
TypeScript84%
Updated 3 weeks 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