{"name":"ssr-window","version":"5.0.0","keywords":["ssr","window","document"],"author":{"name":"Vladimir Kharlampidi"},"license":"MIT","_id":"ssr-window@5.0.0","maintainers":[{"name":"nolimits4web","email":"nolimits4web@gmail.com"}],"homepage":"https://github.com/nolimits4web/ssr-window","bugs":{"url":"https://github.com/nolimits4web/ssr-window/issues"},"dist":{"shasum":"d9255c2c17025d54ac85d3343b74bda8cbe397c9","tarball":"http://registry-npm.ywwl.com/ssr-window/download/ssr-window-5.0.0.tgz","fileCount":12,"integrity":"sha512-3Iqawoo0DkAaUEScd80SYq3I5clEFDVy//DdzjHXACj/hqcKzsnMzRZ1yHRj+r5dW3UeXNs30ofnhP6YSWg5iA==","signatures":[{"sig":"MEUCIBRXYe1pjWCZRqN6n9lS7vkLlrXH274p5JUP4f5up+5gAiEA7cbtJt/d3NutQdsnIuquKKJnCnLrsINNf+AWleQVcas=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":21134,"size":6305,"noattachment":false,"key":"/ssr-window/-/ssr-window-5.0.0.tgz"},"main":"./ssr-window.esm.js","type":"module","module":"./ssr-window.esm.js","exports":{".":"./ssr-window.esm.js","./package.json":"./package.json"},"gitHead":"9a8ec20a8d89f021b032f803f11a908fb93f4eec","typings":"types/ssr-window.d.ts","_npmUser":{"name":"nolimits4web","email":"nolimits4web@gmail.com"},"repository":{"url":"git+https://github.com/nolimits4web/ssr-window.git","type":"git"},"_npmVersion":"10.9.0","description":"Better handling for window object in SSR environment","directories":{},"_nodeVersion":"22.12.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/ssr-window_5.0.0_1739368040516_0.48358875579384675","host":"s3://npm-registry-packages-npm-production"},"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":1739368040672,"_cnpm_publish_time":1739368040672,"dist-tags":{"beta":"4.0.0-beta.3","latest":"5.0.1","next":"3.0.0-alpha.4"}}