Happy DOM
Lightweight DOM implementation for server-side rendering and testing without a browser.
Testing npm MIT
Used in agent projects
122
1.0% of 12,697 public repos built with AI coding agents
Rank in testing
#11 of 40
by use in those projects
Downloads
20.5M
npm, last 7 days, happy-dom
GitHub stars
4,697
last push Oct 8, 2026
How Happy DOM is used
Happy DOM is a dependency in 122 of the 12,697 public GitHub projects set up for AI coding agents that we scanned (1.0%), #11 of 40 in testing. The most used alternative there is Vitest. Projects that use it most often also use Vitest (90.2%), Playwright (JavaScript) (54.9%), Testing Library (54.9%).
Often used with Happy DOM
| Vitest | 90.2% of Happy DOM projects · 7.4× more than average |
|---|---|
| Playwright (JavaScript) | 54.9% of Happy DOM projects · 6.2× more than average |
| Testing Library | 54.9% of Happy DOM projects · 7.6× more than average |
| Vite | 69.7% of Happy DOM projects · 3.1× more than average |
| Zod | 58.2% of Happy DOM projects · 3.4× more than average |
| TypeScript | 89.3% of Happy DOM projects · 1.6× more than average |
| ESLint | 69.7% of Happy DOM projects · 1.8× more than average |
| Tailwind CSS | 61.5% of Happy DOM projects · 1.8× more than average |
By coding agent
| Claude Code | 2.3% of projects set up for it |
|---|---|
| GitHub Copilot | 2.2% of projects set up for it |
| Cursor | 1.6% of projects set up for it |
| OpenCode | 4.4% of projects set up for it |
| Gemini CLI | 2.1% of projects set up for it |
| OpenAI Codex | 1.8% of projects set up for it |
Share of public repos configured for each agent that list Happy DOM as a dependency.
Install
| Package | npm install happy-dom |
|---|---|
| Main stacks | TypeScript / JavaScript (94), Next.js (20), Python (3), PHP (2) |
| Example projects | un-pany/v3-admin-vite, ding113/claude-code-hub, ChenyCHENYU/Robot_Admin, koumoul-dev/vuetify-jsonschema-form, nuxt/nuxt.com |
Alternatives to Happy DOM
| Tool | Used in agent projects | Downloads / wk | GitHub stars | License |
|---|---|---|---|---|
| Vitest npm Next-generation testing framework powered by Vite with native ESM. |
1,549 (12.2%) | 123M | 17.2K | MIT |
| Playwright (JavaScript) npm Cross-browser automation library for end-to-end testing. |
1,117 (8.8%) | 74.2M | 97.4K | Apache-2.0 |
| Testing Library npm Testing utilities for React encouraging testing user behavior. |
915 (7.2%) | 68.7M | 19.7K | MIT |
| Jest npm Delightful JavaScript testing framework with minimal configuration. |
702 (5.5%) | 46.3M | 45.6K | MIT |
| jsdom npm JavaScript implementation of web standards for testing DOM interactions. |
681 (5.4%) | 112M | 21.7K | MIT |
| pytest pypi Simple, powerful Python testing framework with fixtures and plugins. |
330 (2.6%) | 196M | 14.6K | — |
| Chai npm BDD/TDD assertion library for Node.js and browsers with expressive syntax. |
305 (2.4%) | 14M | 8,265 | MIT |
| Mocha npm Feature-rich JavaScript test framework for Node.js and browsers. |
281 (2.2%) | 12.6M | 22.9K | MIT |