# Happy DOM

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


Source: https://findsoftware.frbit.cloud/happy-dom/
Last reviewed: 2026-11-09
Listed since: 2026-11-09

## Record

### Links

- repository: https://github.com/capricorn86/happy-dom
- docs: https://github.com/capricorn86/happy-dom/wiki

### Identity

- status: active
- maintainer: David Ortner
- maintainerType: individual
- parent: unknown
- firstRelease: 2019
- hqCountry: unknown

### Kind

- category: library, testing
- hosting: node, bun
- language: javascript
- runtime: node, bun
- runtimeMin: node 20
- basedOn: unknown

### Content

- contentStore: not applicable
- databases: not applicable
- adminUi: not applicable
- headlessApi: not applicable
- templating: not applicable
- i18n: not applicable

### Rendering and deploy

- runsAs: unknown
- renderingModes: not applicable
- installMethod: npm

### License

- licenseModel: open-source
- license: MIT

### Releases

- currentMajor: 21
- latestReleaseDate: 2026-10-20

### Adoption

- githubStargazers: 4740
- packagistDownloads: not applicable
- npmWeeklyDownloads: 33284809
- contributors: 169
- pluginCount: unknown
- packagistMonthlyDownloads: unknown
- ecosystemsMonthlyDownloads: unknown
- httpArchiveSites: unknown
- wordpressActiveInstalls: unknown
- dependentRepos: 3800
- dependentPackages: 1713

### Sources

- urls: https://github.com/capricorn86/happy-dom (read 2026-11-09)
- urls: https://github.com/capricorn86/happy-dom/wiki/Home (read 2026-11-09)
- maintainer: https://github.com/capricorn86/happy-dom/blob/master/LICENSE (read 2026-11-09)
- maintainerType: https://github.com/capricorn86/happy-dom/blob/master/LICENSE (read 2026-11-09)
- firstRelease: https://registry.npmjs.org/happy-dom (read 2026-11-09)
- category: https://github.com/capricorn86/happy-dom (read 2026-11-09)
- category: https://github.com/capricorn86/happy-dom/wiki/Home (read 2026-11-09)
- language: https://github.com/capricorn86/happy-dom (read 2026-11-09)
- runtime: https://github.com/capricorn86/happy-dom/blob/v21.0.4/packages/happy-dom/package.json (read 2026-11-09)
- runtime: https://github.com/capricorn86/happy-dom/wiki/Setup-as-Test-Environment (read 2026-11-09)
- runtimeMin: https://github.com/capricorn86/happy-dom/blob/v21.0.4/packages/happy-dom/package.json (read 2026-11-09)
- installMethod: https://github.com/capricorn86/happy-dom/wiki/Getting-started (read 2026-11-09)
- license: https://github.com/capricorn86/happy-dom (read 2026-11-09)
- licenseModel: https://github.com/capricorn86/happy-dom/blob/master/LICENSE (read 2026-11-09)
- currentMajor: https://github.com/capricorn86/happy-dom/releases/tag/v21.0.4 (read 2026-11-09)
- latestReleaseDate: https://github.com/capricorn86/happy-dom/releases/tag/v21.0.4 (read 2026-11-09)
- githubStargazers: https://api.github.com/repos/capricorn86/happy-dom (read 2026-11-09)
- contributors: https://api.github.com/repos/capricorn86/happy-dom/contributors?per_page=1 (read 2026-11-09)
- npmWeeklyDownloads: https://api.npmjs.org/downloads/range/2026-11-01:2026-11-07/happy-dom (read 2026-11-09)
- dependentPackages: https://packages.ecosyste.ms/api/v1/registries/npmjs.org/packages/happy-dom (read 2026-11-09)
- dependentRepos: https://packages.ecosyste.ms/api/v1/registries/npmjs.org/packages/happy-dom (read 2026-11-09)

## Notes

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](https://github.com/capricorn86/happy-dom/wiki/Setup-as-Test-Environment) 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.

---

Data licensed CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Attributes are recorded, never scored; absent means unknown.
Credit, in full: FindSoftware, CC BY 4.0
