Happy DOM
Reasonable, with limits. 8th of 10 web scraping and HTML parsing.
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
Overall5.5
How strongly do we recommend it for a new project today?
Claude Opus 5.5: 5.0, likely 4.0 to 6.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.
- peers: Cheerio, htmlparser2, Puppeteer and jsdom have far broader direct use
- advisories recent: SSRF and RCE advisories in 2026
- pkgpulse.com/guides/happy-dom-vs-jsdom-2026: Recommended for fast Vitest suites, not scraping
GPT-6.2 Sol: 5.9, likely 4.7 to 7.1
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.
- github.com/capricorn86/happy-dom/releases/tag/v21.0.4: Current stable release includes compiler and isolation fixes.
- github.com/capricorn86/happy-dom/issues/2540: A selector conformance gap remains in the current stable release.
- cheerio.js.org/docs/basics/loading: Cheerio loads URLs and static HTML directly.
- pptr.dev: Puppeteer drives real Chrome or Firefox for rendering and interaction.
Needed by many4.7
How many developers need a tool for this job?
Claude Opus 5.5: 5.0, likely 4.0 to 6.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.
- github description: A browser without its GUI, aimed at testing and DOM work
- github.com/capricorn86/happy-dom/discussions/815: Users ask whether it can replace Puppeteer/Playwright
GPT-6.2 Sol: 4.3, likely 3.1 to 5.7
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.
- github.com/capricorn86/happy-dom/wiki/Browser: Documents URL navigation and access to the loaded document.
- cheerio.js.org/docs/basics/loading: Cheerio covers the common static HTML and URL-loading cases.
- 2025.stateofjs.com/en-US/libraries/testing: Tracks Vitest adoption and offers indirect context for DOM testing demand.
Helps a lot5.7
How well does it do the job for those who need it?
Claude Opus 5.5: 5.0, likely 4.0 to 7.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.
- pkgpulse.com/guides/happy-dom-vs-jsdom-2026: 2-4x faster than jsdom; gaps in CSS, Shadow DOM, SVG
- github.com/vitest-dev/vitest/discussions/1607: Users report missing Web APIs and some moved back to jsdom
- newreleases.io/project/npm/happy-dom/release/20.0.0: v20 disabled JS evaluation by default for security
- advisories GHSA-c8p4-j97h-3vg8: SSRF via iframe/link when parsing untrusted HTML
GPT-6.2 Sol: 6.4, likely 5.3 to 7.6
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.
- github.com/capricorn86/happy-dom/wiki/Browser: Documents navigation, DOM queries, and waiting for page activity.
- npm latestVersion and hasTypes: Stable 21.0.4 includes TypeScript declarations.
- github.com/capricorn86/happy-dom/issues/2540: Users report incorrect case-insensitive attribute selector behavior on 21.0.4.
- github.com/capricorn86/happy-dom/issues/1416: Users report zero element bounds, and the maintainer confirms full rendering is outside scope.
- tautorn.com.br/en/blog/jsdom-vs-happy-dom: Independent React suite ran about 1.5 to 1.6 times faster with Happy DOM 20.14.5.
Holds up over time6.3
Will it still be a good choice in two years?
Claude Opus 5.5: 6.0, likely 5.0 to 7.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.
- github commitsLastYear / releasesLastYear: 132 commits, 81 releases
- github openPullRequests: 187 open PRs
- newreleases.io/project/npm/happy-dom/release/20.0.0: Frequent breaking majors (v19 CJS removal, v20 JS eval off)
GPT-6.2 Sol: 6.6, likely 5.2 to 7.8
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.
- github commitsLastYear, releasesLastYear, openIssues and openPullRequests: 132 commits and 81 releases, with 420 open issues and 187 open pull requests.
- intel.aikido.dev/packages/npm/happy-dom: Lists one npm maintainer and reports concentrated recent contributions.
- github.com/capricorn86/happy-dom/releases/tag/v21.0.0: Changed the default for loading stylesheets and iframes.
- github.com/apache/airflow/pull/76447: Airflow handled the major security upgrade manually on a maintenance branch.
Used widely5.5
How many use it, and is that growing?
Claude Opus 5.5: 6.0, likely 5.0 to 7.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.
- npm downloadsLast4Weeks: 137.8M vs 12.2M a year ago, ratio ~11.3
- dependents.repos: 3,800 repos, far below jsdom and Cheerio
- pkgpulse.com/guides/happy-dom-vs-jsdom-2026: About 3M weekly in March 2026 vs jsdom about 27M
- bluesky posts: 8 posts, low attention similar to peers
GPT-6.2 Sol: 5.0, likely 3.6 to 6.4
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.
- npm downloadsLast4Weeks, downloadsSame4WeeksYearAgo and medianDownloadsRatio: 137.8 million versus 12.2 million downloads, with growth above the catalog baseline.
- dependents, peers dependentRepos and github stars: 3,800 indexed repositories and 4,754 stars. Cheerio and jsdom have much larger indexed footprints.
- bluesky posts and peers blueskyPosts: Eight repository-link posts, including a report of faster Vitest runs.
- bun.com/docs/test/dom: Documents Happy DOM as a development dependency for tests.
- npmjs.com/package/%40happy-dom/global-registrator?activeTab=versions: The companion package has millions of weekly installs.
Vouched for5.4
Who stands behind it being good?
Claude Opus 5.5: 5.0, likely 4.0 to 6.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.
- github.com/vitest-dev/vitest/discussions/1607: Vitest maintainer calls it a faster alternative with missing APIs
- dev.to/scc33/jsdom-vs-happy-dom-navigating-the-nuances-of-javascript-testing-320i: Independent comparison write-up
- hackerNews stories: No HN stories
GPT-6.2 Sol: 5.8, likely 4.5 to 6.9
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.
- vitest.dev/guide/environment: Supports Happy DOM as a built-in environment option.
- bun.com/docs/test/dom: Bun's test runner can set up Happy DOM directly.
- angular.dev/guide/testing: Angular supports Happy DOM as an alternative to its default jsdom setup.
- github.com/apache/airflow/pull/76447: Airflow uses 21.0.4 as a test dependency for its auth manager UI.
- dominicode.com/posts/happy-dom-o-jsdom-tests-unitarios: Independent benchmark and firsthand report document faster tests and a compatibility pitfall.
Safe4.6
How safe is it to depend on?
Claude Opus 5.5: 4.0, likely 3.0 to 5.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.
- nvd.nist.gov/vuln/detail/cve-2026-33943: Code injection RCE in ECMAScriptModuleCompiler, fixed in 20.8.8
- security.snyk.io/vuln/SNYK-JS-HAPPYDOM-21691240: Follow-up incomplete fix, affected <21.0.4
- advisories last24Months: 7 advisories, several HIGH
- scorecard: 6.4 overall; Code-Review 2, Token-Permissions 0
GPT-6.2 Sol: 5.1, likely 3.9 to 6.4
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.
- github.com/advisories/GHSA-c8p4-j97h-3vg8: High-severity server-side request forgery was patched in 21.0.0.
- github.com/advisories/GHSA-834v-8h66-3h79: High-severity host code execution follow-up was patched in 21.0.4.
- github.com/capricorn86/happy-dom/security/policy: Describes the trust boundary and the default of disabled JavaScript evaluation.
- github.com/capricorn86/happy-dom/blob/v21.0.4/.github/workflows/release.yml: GitHub Actions builds, tests, and publishes the npm packages.
- intel.aikido.dev/packages/npm/happy-dom: Lists one npm maintainer.
- scorecard and npm dependencies and license: Scorecard 6.4, with code review at 2 and token permissions at 0. MIT and seven direct dependencies.
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
- npm downloads, 4 weeks
- 138M ×11 in a year
- GitHub stars
- 4.8k
- Commits, 12 months
- 132
- npm version
- 21.0.4 Oct 2026
- Versions, 12 months
- 82
- Advisories, 24 months
- 7 of 8 ever
- OpenSSF Scorecard
- 6.4 out of 10, Nov 2026
- Licence
- MIT
Read on 21 November 2026 from GitHub (capricorn86/happy-dom), npm (happy-dom), OSV and the OpenSSF Scorecard.
Web scraping and HTML parsing
- 8.1Cheerio
- 7.9Puppeteer
- 7.8Crawlee
- 7.3htmlparser2
- 7.1jsdom
- 6.8Stagehand
- 6.8Readability
- 5.5Happy DOM
- 5.4LinkeDOM
- 5.2Selenium WebDriver