@xmldom/xmldom

A pure JavaScript, W3C-standard DOMParser and XMLSerializer for parsing and building XML/HTML documents

Library
npm
v0.9.11
462stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
86/100Excellent
Development Activity88
Maintenance92
Community76
Maturity60
Momentum28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
73/100Good
Architecture78
Code Quality82
Innovation62
Learning Curve70

@xmldom/xmldom is a dependency-free JavaScript implementation of the DOM Level 2 Core API, providing DOMParser and XMLSerializer classes that work identically in Node.js and browsers. It exists to fill the gap left by document.implementation not being available server-side, giving Node code (and any environment lacking a native DOM) a spec-compliant way to parse XML/HTML strings into a traversable DOM tree and serialize a tree back to a string.

What You Get

  • A DOMParser class with parseFromString() that turns an XML or HTML string into a standards-compliant DOM Document
  • An XMLSerializer class that turns a DOM tree back into a string, mirroring the browser API
  • A hand-written SAX-style tokenizer (lib/sax.js) and grammar module underpinning the parser, with no native bindings or WASM to install
  • Configurable error/warning handling via onError callbacks so malformed input can be caught instead of silently producing a broken tree

Common Use Cases

  • Parsing XML config files, SOAP responses, RSS/Atom feeds, or SVG documents in a Node.js backend with no DOM available
  • Server-side rendering or testing code that expects browser DOM APIs (DOMParser/XMLSerializer) but runs outside a browser
  • Feeding parsed documents into XPath libraries (e.g. xpath) that expect a DOM Level 2 tree to query against
  • Manipulating and re-serializing HTML/XML documents in build tools, static site generators, or CLI utilities

Under The Hood

Architecture The library is organized around a small set of focused modules: sax.js implements a hand-rolled streaming tokenizer that walks the input string and emits parse events; dom-parser.js consumes those events to build up a DOM tree using the Document/Node/Element classes defined in the large dom.js (3,500+ lines implementing DOM Level 2 Core); entities.js handles the full HTML/XML named-entity decoding table; and errors.js/conventions.js centralize error typing and shared helpers. There is no external parsing dependency — the tokenizer, grammar, and DOM implementation are all original code. Tech Stack Pure JavaScript (CommonJS, lib/index.js as the entry point) with hand-authored TypeScript declarations (index.d.ts) shipped alongside rather than generated from source; zero runtime dependencies keep the install footprint small, and the dev toolchain uses Jest for testing, ESLint/Prettier for style, and auto-changelog for release notes. Code Quality The test suite is substantial — 64+ test files under test/ covering dom, dom-parser, entities, errors, grammar, HTML parsing, and dedicated conformance/parse suites, plus a jest.fuzz.config.js for fuzz testing malformed input, which is unusually thorough for a parser library and reflects real-world hardening against XML edge cases (external entities, malformed tags, encoding quirks). API Design The public API deliberately mirrors the browser’s native DOMParser/XMLSerializer interfaces, so code written against real browser DOM parsing can often switch to this package with a single import change and no rewrites; the tradeoff is that advanced configuration (custom error handling, MIME type selection) requires reaching for slightly less-discoverable constructor options rather than a fluent builder API.

Used by 12 apps in this directory

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
89%
Other

FastGPT

AI Agents · AI Development

29,387

Build, debug, and deploy knowledge-based AI agents with a visual workflow editor, RAG retrieval, and support for any OpenAI-compatible LLM.

View details
93
Repo Health
84
Technical
70
Dependency
Built with
TypeScript89%
Updated today
TypeScript
74%
Apache 2.0

Jitsi Meet

Team Chat · Collaboration · Video Conferencing

29,767

Open-source, end-to-end encrypted video conferencing you can self-host or embed into any web or mobile app.

View details
96
Repo Health
85
Technical
70
Dependency
Built with
TypeScript74%
JavaScript10%
Updated yesterday
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
96%
Other

nango

Developer Tools · Automation · Authentication

11,501

Build product integrations with AI using 800+ APIs — auth, proxy, and TypeScript functions on production-grade infrastructure.

View details
94
Repo Health
85
Technical
69
Dependency
Built with
TypeScript96%
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
JavaScript
87%
GPL 3.0

NodeBB

Community

15,199

Modern Node.js forum software with real-time WebSockets, multi-database support, and a plugin ecosystem — the community platform built for the open web and the Fediverse.

View details
97
Repo Health
78
Technical
71
Dependency
Built with
JavaScript87%
Go Template12%
Updated today
TypeScript
92%
Apache 2.0

OneUptime

Monitoring

7,481

The complete open-source observability platform that replaces PagerDuty, Datadog, Sentry, and StatusPage with a single self-hostable system.

View details
90
Repo Health
81
Technical
66
Dependency
Built with
TypeScript92%
Updated today
JavaScript
63%
AGPL 3.0

overleaf

Collaboration · Productivity

18,035

Open-source, real-time collaborative LaTeX editor with sandboxed compilation and full TeXLive support for self-hosted academic and research teams.

View details
84
Repo Health
80
Technical
67
Dependency
Built with
JavaScript63%
TypeScript29%
Updated 1 months 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