{"id":15353668,"url":"https://github.com/nolimits4web/ssr-window","last_synced_at":"2025-10-24T11:54:08.888Z","repository":{"id":40768860,"uuid":"121015472","full_name":"nolimits4web/ssr-window","owner":"nolimits4web","description":"Better handling for window object in SSR environment","archived":false,"fork":false,"pushed_at":"2023-01-07T23:19:36.000Z","size":919,"stargazers_count":135,"open_issues_count":15,"forks_count":20,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-29T20:55:56.826Z","etag":null,"topics":["server-side-rendering","ssr","ssr-environment","ssr-window"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nolimits4web.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"patreon":"vladimirkharlampidi"}},"created_at":"2018-02-10T12:56:28.000Z","updated_at":"2024-08-06T02:33:13.000Z","dependencies_parsed_at":"2023-02-08T03:16:57.670Z","dependency_job_id":null,"html_url":"https://github.com/nolimits4web/ssr-window","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nolimits4web%2Fssr-window","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nolimits4web%2Fssr-window/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nolimits4web%2Fssr-window/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nolimits4web%2Fssr-window/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nolimits4web","download_url":"https://codeload.github.com/nolimits4web/ssr-window/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248636831,"owners_count":21137527,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["server-side-rendering","ssr","ssr-environment","ssr-window"],"created_at":"2024-10-01T12:14:50.030Z","updated_at":"2025-10-24T11:54:03.847Z","avatar_url":"https://github.com/nolimits4web.png","language":"JavaScript","funding_links":["https://patreon.com/vladimirkharlampidi"],"categories":[],"sub_categories":[],"readme":"# SSR Window\n\nBetter handling for `window` and `document` object in SSR environment.\n\nThis library doesn't implement the DOM (like JSDOM), it just patches (or creates `window` and `document` objects) to avoid them to fail (throw errors) during server-side rendering.\n\nWas created for use in:\n\n- [Dom7](https://github.com/nolimits4web/dom7)\n- [Swiper](https://github.com/nolimits4web/swiper)\n- [Framework7](https://github.com/framework7io/framework7)\n\n## Installation\n\nLibrary available on NPM:\n\n```\nnpm i ssr-window\n```\n\n## Usage\n\n```js\nimport { getWindow, getDocument } from 'ssr-window';\n\nconst window = getWindow();\nconst document = getDocument();\n\nwindow.addEventListener('resize', () =\u003e {});\n\nconst div = document.querySelectorAll('div');\n```\n\n## Extending\n\nIf you rely on some window/document properties which are not included here, you can use `extend` helper to add them:\n\n```js\nimport { ssrWindow, ssrDocument, extend } from 'ssr-window';\n\n// add window.navigator.language\nextend(ssrWindow, {\n  navigator: {\n    language: 'en',\n  },\n});\n\n// add document.body\nextend(ssrDocument, {\n  body: {\n    /* ... */\n  },\n});\n```\n\n## Contribution\n\nYes please! See the [contributing guidelines](https://github.com/nolimits4web/ssr-window/blob/master/CONTRIBUTING.md) for details.\n\n## Licence\n\nThis project is licensed under the terms of the [MIT license](https://github.com/nolimits4web/ssr-window/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnolimits4web%2Fssr-window","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnolimits4web%2Fssr-window","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnolimits4web%2Fssr-window/lists"}