# capricorn86/happy-dom

A JavaScript implementation of a web browser without its graphical user interface

Repository: https://github.com/capricorn86/happy-dom
Canonical: https://ross.abutalabs.com/products/happy-dom
Language: TypeScript
License: MIT
License Family: permissive
Topics: javascript, typescript, nodejs, html, dom, browser, whatwg, react, angular, vue, lit-element, lit-html, web-components, vitest, jest, bun, testing-library, svelte, hacktoberfest2025, hacktoberfest
Last push: 2026-08-26T22:55:12+00:00

## Health v2 (maintenance only)
Score: 95/100 (v2, computed 2026-09-03T02:39:23.370411+00:00)
- activity 99, release rhythm 87, longevity 100
- inputs: {"age_days": 2550, "days_push": 7, "days_rel": 7, "gap_med": 0.0, "n_releases_24m": 175}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4619, forks 314 (observed 2026-08-28T04:08:55.131609+00:00)

## What it is
Happy DOM is a JavaScript implementation of a web browser without its graphical user interface, providing a DOM implementation for Node.js and Bun. It is commonly used as a test environment for frontend frameworks and testing libraries like Vitest, Jest, and Testing Library.

## Use cases
- test React components in Jest without a real browser
- run Vitest tests with a DOM environment
- parse and manipulate HTML in Node.js
- test web components with Custom Elements and Shadow DOM support
- scrape web pages by parsing HTML with a DOM API
- test Vue, Svelte, or Angular components headlessly

## When to choose
- you need a fast, lightweight DOM for unit tests instead of a full headless browser
- you want Custom Elements, Shadow DOM, Mutation Observer, or Fetch API support in tests
- you use Testing Library with Vitest, Jest, or Bun

## When to avoid
- you need real browser rendering, layout, or full JavaScript engine behavior
- you need pixel-accurate screenshots or end-to-end browser automation
- your code depends on browser APIs Happy DOM does not implement

## Facets
- artifact type: library
- maturity: active
- function: testing, parser, http-client, web-scraping
- domain: web-development, testing, frontend, developer-tools
- platform: bun
- tags: headless-browser, dom-implementation, web-components, shadow-dom, vitest, jest, testing-library, whatwg, nodejs, javascript, typescript

## Member repositories
- capricorn86/happy-dom (main) score 95

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:55.131609+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:19:39.866341+00:00, confidence not recorded.
  - readme: https://github.com/capricorn86/happy-dom (fetched 2026-08-28T04:08:55.131609+00:00, sha 8c1cec5cc8fe)
- Data as of 2026-08-30T08:39:29.467469+00:00.
