FindSoftware

Happy DOM

JavaScript implementation of a web browser's DOM without a graphical interface, used for testing and server-side rendering.

Happy DOM is a JavaScript implementation of a web browser without its graphical user interface. It is written in TypeScript and provides DOM features such as custom elements, declarative shadow DOM, mutation observers, tree walkers and the Fetch API. The project describes its purpose as emulating enough of a browser for testing, scraping web sites and server-side rendering, and the wiki names JSDOM as an alternative to it.

Test runners use it as their DOM environment. The setup guide covers Vitest, Bun and the Node.js test runner.

Worth knowing

With Vitest, the wiki says that the timer methods of the window do not work fully by default, because Vitest does not use the timer methods of Happy DOM. The guide gives a setup-file workaround that copies those functions into the global scope.

Identity

Status
Active
Maintainer
David Ortner3
Maintained by
Individual3
First release
20194

Rendering and deploy

Install with
npm7

Releases

Current major version
218
Last release
2026-10-208

Adoption

GitHub stars
4,7409
npm downloads a week
33,284,80911
Contributors
16910
Dependent repositories
3,80012
Dependent packages
1,71312

Why these figures do not compare

Sources

  1. 2026-11-09: links, Categories, Written in, License
    github.com/capricorn86/happy-dom
  2. 2026-11-09: links, Categories
    github.com/capricorn86/happy-dom/wiki/Home
  3. 2026-11-09: Maintainer, Maintained by, License model
    github.com/capricorn86/happy-dom/blob/master/LICENSE
  4. 2026-11-09: First release
    registry.npmjs.org/happy-dom
  5. 2026-11-09: Runtime, Minimum runtime
    github.com/capricorn86/happy-dom/blob/v21.0.4/packages/happy-dom/package.json
  6. 2026-11-09: Runtime
    github.com/capricorn86/happy-dom/wiki/Setup-as-Test-Environment
  7. 2026-11-09: Install with
    github.com/capricorn86/happy-dom/wiki/Getting-started
  8. 2026-11-09: Current major version, Last release
    github.com/capricorn86/happy-dom/releases/tag/v21.0.4
  9. 2026-11-09: GitHub stars
    api.github.com/repos/capricorn86/happy-dom
  10. 2026-11-09: Contributors
    api.github.com/repos/capricorn86/happy-dom/contributors?per_page=1
  11. 2026-11-09: npm downloads a week
    api.npmjs.org/downloads/range/2026-11-01:2026-11-07/happy-dom
  12. 2026-11-09: Dependent packages, Dependent repositories
    packages.ecosyste.ms/api/v1/registries/npmjs.org/packages/happy-dom

Last reviewed · Listed since Edit on GitHubThis page as markdownas JSON