A JavaScript implementation of a web browser without its graphical user interface
Installations
npm install happy-dom
Developer Guide
Typescript
Yes
Module System
ESM
Min. Node Version
>=18.0.0
Node Version
22.12.0
NPM Version
10.9.0
Releases
Contributors
Languages
TypeScript (99.37%)
JavaScript (0.63%)
Developer
capricorn86
Download Statistics
Total Downloads
58,466,210
Last Day
69,669
Last Week
441,200
Last Month
3,894,974
Last Year
40,979,648
GitHub Statistics
3,492 Stars
2,120 Commits
210 Forks
13 Watching
3 Branches
124 Contributors
Package Meta Information
Latest Version
16.3.0
Package Id
happy-dom@16.3.0
Unpacked Size
11.98 MB
Size
1.44 MB
File Count
4,759
NPM Version
10.9.0
Node Version
22.12.0
Publised On
01 Jan 2025
Total Downloads
Cumulative downloads
Total Downloads
58,466,210
Last day
-17.1%
69,669
Compared to previous day
Last week
-47.4%
441,200
Compared to previous week
Last month
-9.9%
3,894,974
Compared to previous month
Last year
189.2%
40,979,648
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
2
Dev Dependencies
6
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
Performance
Operation | JSDOM | Happy DOM |
---|---|---|
Import / Require | 333 ms | 45 ms |
Parse HTML | 256 ms | 26 ms |
Serialize HTML | 65 ms | 8 ms |
Render custom element | 214 ms | 19 ms |
querySelectorAll('tagname') | 4.9 ms | 0.7 ms |
querySelectorAll(':nth-child(2n+1)') | 10.4 ms | 3.8 ms |
See how the test was done here
Stable Version
Stable Version
16.3.0
CRITICAL
1
0/10
Summary
happy-dom allows for server side code to be executed by a <script> tag
Affected Versions
< 15.10.2
Patched Versions
15.10.2
Reason
30 commit(s) and 18 issue activity found in the last 90 days -- score normalized to 10
Reason
security policy file detected
Details
- Info: security policy file detected: SECURITY.md:1
- Info: Found linked content: SECURITY.md:1
- Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1
- Info: Found text in security policy: SECURITY.md:1
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
SAST tool is not run on all commits -- score normalized to 6
Details
- Warn: 18 commits out of 30 are checked with a SAST tool
Reason
Found 12/29 approved changesets -- score normalized to 4
Reason
dependency not pinned by hash detected -- score normalized to 4
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pull_request.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/capricorn86/happy-dom/pull_request.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pull_request.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/capricorn86/happy-dom/pull_request.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/pull_request.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/capricorn86/happy-dom/pull_request.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pull_request.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/capricorn86/happy-dom/pull_request.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pull_request.yml:39: update your workflow using https://app.stepsecurity.io/secureworkflow/capricorn86/happy-dom/pull_request.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pull_request.yml:49: update your workflow using https://app.stepsecurity.io/secureworkflow/capricorn86/happy-dom/pull_request.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:61: update your workflow using https://app.stepsecurity.io/secureworkflow/capricorn86/happy-dom/release.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:68: update your workflow using https://app.stepsecurity.io/secureworkflow/capricorn86/happy-dom/release.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:73: update your workflow using https://app.stepsecurity.io/secureworkflow/capricorn86/happy-dom/release.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:76: update your workflow using https://app.stepsecurity.io/secureworkflow/capricorn86/happy-dom/release.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:87: update your workflow using https://app.stepsecurity.io/secureworkflow/capricorn86/happy-dom/release.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:129: update your workflow using https://app.stepsecurity.io/secureworkflow/capricorn86/happy-dom/release.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:135: update your workflow using https://app.stepsecurity.io/secureworkflow/capricorn86/happy-dom/release.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:140: update your workflow using https://app.stepsecurity.io/secureworkflow/capricorn86/happy-dom/release.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:159: update your workflow using https://app.stepsecurity.io/secureworkflow/capricorn86/happy-dom/release.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/capricorn86/happy-dom/release.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/capricorn86/happy-dom/release.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/capricorn86/happy-dom/release.yml/master?enable=pin
- Info: 0 out of 16 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 2 third-party GitHubAction dependencies pinned
- Info: 4 out of 4 npmCommand dependencies pinned
Reason
6 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-96g7-g7g9-jxw8
- Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55
- Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w
- Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/auto-assign.yml:1
- Warn: no topLevel permission defined: .github/workflows/pull_request.yml:1
- Warn: no topLevel permission defined: .github/workflows/release.yml:1
- Info: no jobLevel write permissions found
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Score
6
/10
Last Scanned on 2024-12-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to happy-dom
@yankeeinlondon/happy-wrapper
A functional API surface wrapping happy-dom
@happy-dom/global-registrator
Use Happy DOM globally in a Node.js environment for testing.
@happy-dom/jest-environment
Use Happy DOM as environment in Jest.
@geovistory/design-system-happy-dom
geovistory.org's design system: HappyDOM worker