{"name":"ssr-window","version":"5.0.1","description":"Better handling for window object in SSR environment","main":"./ssr-window.esm.js","module":"./ssr-window.esm.js","exports":{"./package.json":"./package.json",".":{"default":"./ssr-window.esm.js","types":"./types/ssr-window.d.ts"}},"typings":"types/ssr-window.d.ts","type":"module","repository":{"type":"git","url":"git+https://github.com/nolimits4web/ssr-window.git"},"keywords":["ssr","window","document"],"author":{"name":"Vladimir Kharlampidi"},"license":"MIT","bugs":{"url":"https://github.com/nolimits4web/ssr-window/issues"},"homepage":"https://github.com/nolimits4web/ssr-window","_id":"ssr-window@5.0.1","gitHead":"a833fbc80a06976ead100a146cbb4f5366363645","_nodeVersion":"22.12.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-WVXlhQsm54HC+FnJfEbccEgNF7mKXtnFUB8Xn7rx2dsWHOlBdqezdX88Vjh6pVGaa0ZvL+PoSu7rEcBuNmxt6g==","shasum":"26c3b5bf6dd5ad21a8ef0545de5bf8662dc1d3ab","tarball":"http://registry-npm.ywwl.com/ssr-window/download/ssr-window-5.0.1.tgz","fileCount":12,"unpackedSize":21189,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCd8G7MIvzkfMMyjt/wdA8248NQ5R6yYUkXjZxzLZrMMAIgXgFAH8PVF49pKlUmDQ7LMFy/jFhAEExSpsEKuGDAclo="}],"size":6319,"noattachment":false,"key":"/ssr-window/-/ssr-window-5.0.1.tgz"},"_npmUser":{"name":"nolimits4web","email":"nolimits4web@gmail.com","actor":{"name":"nolimits4web","email":"nolimits4web@gmail.com","type":"user"}},"directories":{},"maintainers":[{"name":"nolimits4web","email":"nolimits4web@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ssr-window_5.0.1_1751041652057_0.3031059050105056"},"_hasShrinkwrap":false,"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 { window, document } from 'ssr-window';\n\nwindow.addEventListener('resize', () => {});\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 { window, document, extend } from 'ssr-window';\n\n// add window.navigator.language\nextend(window, {\n  navigator: {\n    language: 'en',\n  },\n});\n\n// add document.body\nextend(document, {\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","publish_time":1751041652232,"_cnpm_publish_time":1751041652232,"dist-tags":{"beta":"4.0.0-beta.3","latest":"5.0.1","next":"3.0.0-alpha.4"}}