Installations
npm install @happy-dom/global-registrator
Developer Guide
Typescript
Yes
Module System
ESM
Min. Node Version
>=18.0.0
Node Version
22.13.1
NPM Version
10.9.2
Score
84.4
Supply Chain
80.6
Quality
95.3
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Languages
TypeScript (99.36%)
JavaScript (0.63%)
HTML (0.01%)
Developer
capricorn86
Download Statistics
Total Downloads
1,556,426
Last Day
8,788
Last Week
37,712
Last Month
148,200
Last Year
1,342,100
GitHub Statistics
3,573 Stars
2,141 Commits
215 Forks
15 Watching
7 Branches
127 Contributors
Bundle Size
660.67 kB
Minified
139.21 kB
Minified + Gzipped
Package Meta Information
Latest Version
16.8.1
Package Id
@happy-dom/global-registrator@16.8.1
Unpacked Size
26.24 kB
Size
5.74 kB
File Count
24
NPM Version
10.9.2
Node Version
22.13.1
Publised On
31 Jan 2025
Total Downloads
Cumulative downloads
Total Downloads
1,556,426
Last day
9.2%
8,788
Compared to previous day
Last week
-4.9%
37,712
Compared to previous week
Last month
20.9%
148,200
Compared to previous month
Last year
627.1%
1,342,100
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
This package makes it possible to register Happy DOM in the global scope, e.g. for testing purposes.
Installation
1npm install @happy-dom/global-registrator --save-dev
Usage
Register
1import { GlobalRegistrator } from '@happy-dom/global-registrator'; 2 3GlobalRegistrator.register({ url: 'http://localhost:3000', width: 1920, height: 1080 }); 4 5document.body.innerHTML = `<button>My button</button>`; 6 7const button = document.querySelector('button'); 8 9// Outputs: "My button" 10console.log(button.innerText);
Unregister
1import { GlobalRegistrator } from '@happy-dom/global-registrator'; 2 3GlobalRegistrator.register(); 4 5await GlobalRegistrator.unregister(); 6 7// Outputs: "undefined" 8console.log(global.document);
Happy DOM
Documentation | Getting Started | Setup as Test Environment | GitHub
![Empty State](/_next/static/media/empty.e5fae2e5.png)
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
30 commit(s) and 15 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 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 7
Details
- Warn: 21 commits out of 30 are checked with a SAST tool
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: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
- 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
- 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
7 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
- Warn: Project is vulnerable to: GHSA-vg6x-rcgg-rjx6
Reason
Found 8/30 approved changesets -- score normalized to 2
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
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Score
5.8
/10
Last Scanned on 2025-01-27
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 More