Launch Week Day 1: Socket for Jira Is Now Available.Learn More
Socket
Book a DemoSign in
Socket

happy-dom

Package Overview
Dependencies
Maintainers
1
Versions
737
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

happy-dom

Happy DOM is a JavaScript implementation of a web browser without its graphical user interface. It includes many web standards from WHATWG DOM and HTML.

latest
Source
npmnpm
Version
20.9.0
Version published
Weekly downloads
6.8M
10.36%
Maintainers
1
Weekly downloads
 
Created
Source

Happy DOM Logo

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

DOM Features

  • Custom Elements (Web Components)

  • Declarative Shadow DOM

  • Mutation Observer

  • Tree Walker

  • Fetch API

And much more..

Documentation

Documentation | Getting Started | Setup as Test Environment | GitHub

Works With

Vitest | Bun | Jest | Testing Library | Google LitElement | Vue | React | Svelte | Angular

Module Systems

ESM | CommonJS

Performance

OperationJSDOMHappy DOM
Import / Require333 ms45 ms
Parse HTML256 ms26 ms
Serialize HTML65 ms8 ms
Render custom element214 ms19 ms
querySelectorAll('tagname')4.9 ms0.7 ms
querySelectorAll(':nth-child(2n+1)')10.4 ms3.8 ms

See how the test was done here

Keywords

jsdom

FAQs

Package last updated on 13 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts