{"id":19760121,"url":"https://github.com/videsk/window-node-polyfill","last_synced_at":"2026-01-31T08:02:59.493Z","repository":{"id":57169158,"uuid":"344310927","full_name":"videsk/window-node-polyfill","owner":"videsk","description":"Polyfill of window in Nodejs for testing purpose","archived":false,"fork":false,"pushed_at":"2024-07-29T19:44:15.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-04T20:13:46.426Z","etag":null,"topics":["javascript-library","mocha","nodejs","window"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/videsk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-04T01:15:49.000Z","updated_at":"2024-07-29T19:44:19.000Z","dependencies_parsed_at":"2025-03-25T04:41:49.375Z","dependency_job_id":"9c89b0b3-941a-4d78-a875-bd7eacc3c921","html_url":"https://github.com/videsk/window-node-polyfill","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/videsk/window-node-polyfill","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/videsk%2Fwindow-node-polyfill","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/videsk%2Fwindow-node-polyfill/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/videsk%2Fwindow-node-polyfill/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/videsk%2Fwindow-node-polyfill/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/videsk","download_url":"https://codeload.github.com/videsk/window-node-polyfill/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/videsk%2Fwindow-node-polyfill/sbom","scorecard":{"id":920799,"data":{"date":"2025-08-11","repo":{"name":"github.com/videsk/window-node-polyfill","commit":"cfe039e77d32abee40d7c209c5dff43cbf72994c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":0,"reason":"Found 0/7 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU Lesser General Public License v2.1: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":6,"reason":"branch protection is not maximal on development and all release branches","details":["Info: 'allow deletion' disabled on branch 'master'","Info: 'force pushes' disabled on branch 'master'","Warn: 'branch protection settings apply to administrators' is disabled on branch 'master'","Warn: 'stale review dismissal' is disabled on branch 'master'","Warn: required approving review count is 1 on branch 'master'","Warn: codeowners review is required - but no codeowners file found in repo","Info: 'last push approval' is required to merge on branch 'master'","Warn: no status checks found to merge onto branch 'master'","Info: PRs are required in order to make changes on branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}}]},"last_synced_at":"2025-08-25T02:23:12.556Z","repository_id":57169158,"created_at":"2025-08-25T02:23:12.556Z","updated_at":"2025-08-25T02:23:12.556Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28934625,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T07:49:44.436Z","status":"ssl_error","status_checked_at":"2026-01-31T07:49:34.274Z","response_time":128,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript-library","mocha","nodejs","window"],"created_at":"2024-11-12T03:35:35.842Z","updated_at":"2026-01-31T08:02:59.449Z","avatar_url":"https://github.com/videsk.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Window polyfill for NodeJS\n\nNodejs doesn't have `window` object (obviously, not?). So, when you want to test pure Javascript or Typescript code that have `window` dependencies like `localStorage` and many more that are only able on browsers, your tests will not works, because you will get the `XXXX is not defined` error.\n\nSo, this library was designed to use in Node testing environment with mocha, chai, etc. where have browsers APIs dependencies. Some features of browsers was don't do what do you want like `document.createElement('div')`, but will returns you an object where you have access to properties and functions.\n\nIf you don't use a `window` polyfill you will get an error like this:\n\n```js\nwindow is not defined\n```\n\n## How to use\n\nFirst install as dev dependency, **never use in production server**:\n\n```js\nnpm i @videsk/window-node-polyfill -D\n```\n\nOnly need add on teh top of the test file, like this:\n\n```js\nrequire('@videsk/window-node-polyfill');\n...\n```\n\nThen you can access to the current properties:\n\n- `window`\n- `window.localStorage`\n- `window.sessionStorage`\n- `document`\n- `document.createElement`\n- `document.body`\n- `document.body.appendChild`\n- `window.location`\n- `window.top`\n- `window.parent`\n\n## Storage\n\n```js\n// window.localStorage or window.sessionStorage\nwindow.localStorage.getItem('my-key');\nwindow.localStorage.setItem('my-key', 'my-value');\nwindow.localStorage.removeItem('my-key');\n``` \n\n## Document\n\n```js\nconst element = document.createElement('div');\ntypeof element // object\n```\n\n## Contributions\n\nIf you want add more properties, you're welcome, so send you PR or issue with feature request.\n\n## Copyrights\n\nLGPL-2.1 License - By Videsk™\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvidesk%2Fwindow-node-polyfill","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvidesk%2Fwindow-node-polyfill","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvidesk%2Fwindow-node-polyfill/lists"}