# Happy DOM: 5.5 out of 10

Reasonable, with limits. 8th of 10 in [Web scraping and HTML parsing](https://elestia.ai/opensource/scraping/index.md).

Happy DOM is a fast JavaScript DOM and browser implementation for Node. It is used mostly as the DOM environment for Vitest tests. For scraping and parsing HTML it works, but Cheerio or htmlparser2 parse HTML more simply, Puppeteer loads real pages more faithfully, and Happy DOM's 2026 record of RCE and SSRF advisories with untrusted HTML makes it a risky choice for reading pages from the open web.

**Best for:** Teams that want a fast, in-process DOM for unit tests or for trusted HTML, and do not need a real browser.

## Scores

- **Overall: 5.5** (likely 4.4 to 6.6)
  - Claude Opus 5.5 (5.0): Happy DOM is a good, fast DOM for tests. In the web scraping and HTML parsing category, Cheerio or htmlparser2 parse HTML better, and Puppeteer or Crawlee load real pages better. Its run of security advisories around untrusted HTML argues against pointing it at the open web. Choose it for trusted HTML or test-like workloads only.
  - GPT-6.2 Sol (5.9): Happy DOM is actively maintained and useful when extraction code needs browser-style DOM objects for trusted HTML. Choose Cheerio for straightforward static extraction or Puppeteer for pages that depend on client-side rendering. Current selector gaps and limited evidence from production scrapers make the recommendation depend on the pages you need to handle.
- **Needed by many: 4.7** (likely 3.6 to 5.9)
  - Claude Opus 5.5 (5.0): Many front-end developers need a headless DOM for tests. Fewer need one to load and read web pages, which is this category's job. Happy DOM's in-process browser fits that job only for simple, trusted pages. Most scraping needs go to a parser or a real browser instead.
  - GPT-6.2 Sol (4.3): Loading and reading HTML is a recurring need in scraping and data pipelines. Happy DOM fits the smaller group that wants browser-style DOM APIs without launching a browser. Testing gives it a wider audience, but available usage data makes it hard to size the scraping audience.
- **Helps a lot: 5.7** (likely 4.7 to 7.3)
  - Claude Opus 5.5 (5.0): It parses HTML and offers a broad DOM, fetch and a Browser API, and it is quicker than jsdom. Users report missing or partial APIs (getComputedStyle, Shadow DOM, SVG, history), and some jsdom behaviours differ. For scraping, JS evaluation is now off by default for safety, and the SSRF advisory shows that parsing untrusted HTML can trigger outbound requests. Cheerio or a real browser does the scraping job better.
  - GPT-6.2 Sol (6.4): Version 21.0.4 combines documented navigation with familiar DOM methods and bundled types. These APIs give coding agents a familiar starting point. Users reproduced selector bugs on this release, and the emulator lacks a layout engine. Independent speed tests favor Happy DOM over jsdom on several test workloads, but they leave scraping throughput uncertain.
- **Holds up over time: 6.3** (likely 5.1 to 7.4)
  - Claude Opus 5.5 (6.0): Development is active, with 132 commits and 81 releases in the last year and a push three days before the read date. The work rests mostly on one maintainer, and 187 pull requests are open. Major versions with breaking changes come often. Vitest support keeps the ecosystem tied to it.
  - GPT-6.2 Sol (6.6): The project shipped 81 releases and recorded 132 commits in the past year. A single listed npm maintainer and a substantial issue and pull request backlog make long-term support less predictable. Recent major releases tightened defaults for good security reasons, though downstream projects still had to accommodate the changes.
- **Used widely: 5.5** (likely 4.3 to 6.7)
  - Claude Opus 5.5 (6.0): Downloads rose about 11x in a year, to 138M per 4 weeks. That is far above the 4.1 median, but the jump is so sharp that a popular tool probably installs it as a dependency. Dependents (3,800 repos) are tiny next to jsdom's 1.4M and Cheerio's 557k, though they are above LinkeDOM's. Most direct use is in tests rather than scraping.
  - GPT-6.2 Sol (5.0): Four-week downloads rose to 137.8 million, or 11.3 times the year-earlier count against a catalog median of 4.1 times. The dependency index found 3,800 repositories and 1,713 npm packages, with far fewer indexed repositories than for Cheerio or jsdom. Test automation and installs through companion packages make it hard to infer how much of that growth comes from new scraping projects.
- **Vouched for: 5.4** (likely 4.3 to 6.5)
  - Claude Opus 5.5 (5.0): Vitest ships it as a first-class environment, and independent guides recommend it for fast test suites. Its users are mostly Vue/Nuxt and Vitest projects. There are no independent endorsements of it as a scraping tool, and comparisons still describe jsdom as more mature.
  - GPT-6.2 Sol (5.8): Vitest, Bun, and Angular support Happy DOM for tests, and Apache Airflow uses it in its UI test suite. Independent benchmarks find a speed advantage on some DOM test workloads. Evidence from production scrapers is sparse, which limits how far those endorsements carry in this category.
- **Safe: 4.6** (likely 3.5 to 5.7)
  - Claude Opus 5.5 (4.0): There were seven advisories in 24 months, mostly high severity. They include a VM escape, RCE through the module compiler, an incomplete fix for that RCE, cookie scope flaws and SSRF on untrusted HTML. Fixes did ship, but repeat issues in the same area are a concern for a scraping tool. The Scorecard is 6.4, with weak Code-Review and Token-Permissions. The licence is MIT and it has only 7 dependencies.
  - GPT-6.2 Sol (5.1): The recent server-side request forgery and host code execution fixes are both in 21.0.4 and shipped by public disclosure. One fixed a gap left by earlier remediation, and the project warns against running untrusted JavaScript in the application process. The package uses MIT and has seven direct dependencies, and the publishing workflow runs tests before release. Weak review and token-permission scores, a single listed npm maintainer, and the difference between parsing and script execution keep the range wide.

## Good

- Faster startup and parsing than jsdom, which shortens large Vitest suites.
- Vitest supports it as a built-in environment, and switching is a one-line config change.
- Ships TypeScript types, is MIT-licensed and has only 7 dependencies.
- Very frequent releases: 81 in the last year, so fixes land quickly.

## Bad

- Seven advisories in 24 months, including RCE in its module compiler, an incomplete fix for it, and SSRF when parsing untrusted HTML.
- Less complete than jsdom for computed styles, Shadow DOM, SVG and some navigation APIs.
- Mostly one maintainer, with 187 open pull requests and a weak Code-Review score.
- Breaking majors come often (v19 dropped CommonJS, v20 turned JS evaluation off by default, then v21).

## The numbers

- Downloads, 4 weeks: 138M
- In a year: ×11
- GitHub stars: 4.8k
- Commits, 12 months: 132
- Last npm release: Oct 2026
- Advisories, 24 months: 7
- Licence: MIT
- GitHub: https://github.com/capricorn86/happy-dom
- npm: https://www.npmjs.com/package/happy-dom

Scores run from 0 to 10 and are the mean of the scores of AI reviewers (Claude Opus 5.5, GPT-6.2 Sol), made on 22 November 2026 from GitHub, npm, OSV, OpenSSF Scorecard, ecosyste.ms, Hacker News and Bluesky data and a web search. The ecosyste.ms count of repositories that use a project is far too low for projects that grew in the last few years, and some reviews quote it. Overall is the reviewers' own judgement for a new project today, not an average of the parts. An AI wrote them and can be wrong.
