{"_id":"window-resizeto","_rev":"2-4ffeee55c07c223833dadda023d167e9","name":"window-resizeto","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"window-resizeto","version":"0.0.1","description":"A window.resizeTo polyfill for test environments like Jest & JSDOM","main":"dist/index.js","module":"dist/index.esm.js","typings":"dist/index.d.ts","author":{"name":"Anton Gilgur"},"license":"Apache-2.0","homepage":"https://github.com/agilgur5/window-resizeTo","repository":{"type":"git","url":"git+https://github.com/agilgur5/window-resizeTo.git"},"bugs":{"url":"https://github.com/agilgur5/window-resizeTo/issues"},"keywords":["window","resizeTo","resize","polyfill","ponyfill","jsdom","jest","test","testing"],"scripts":{"lint":"tsdx lint '**/*.ts'","lint:fix":"npm run lint -- --fix","build":"tsdx build --entry src/index.ts --entry src/polyfill.ts","test":"tsdx test","test:pub":"npm run build && npm pack","pub":"npm run build && npm publish","changelog":"changelog-maker"},"peerDependencies":{},"dependencies":{},"devDependencies":{"@agilgur5/changelog-maker":"^3.0.0","@babel/core":"^7.8.4","babel-eslint":"^10.0.2","eslint":"^6.8.0","eslint-config-standard-with-typescript":"^12.0.1","eslint-plugin-import":"^2.20.1","eslint-plugin-node":"^11.0.0","eslint-plugin-promise":"^4.2.1","eslint-plugin-react":"^7.18.3","eslint-plugin-standard":"^4.0.1","jest-without-globals":"^0.0.3","tsdx":"github:agilgur5/tsdx#dist-multi"},"gitHead":"1228646d639b8b26c3290505c21251e58c66a35a","_id":"window-resizeto@0.0.1","_nodeVersion":"10.16.0","_npmVersion":"6.13.1","dist":{"integrity":"sha512-9Jr5uS14lzcU1dw/vf8Gok9RrYwKm4GYQSPUErbpsjwEoZeuHdDvt9wUR92SUZB6S66W7a+PcVfjdox3xag9+A==","shasum":"f99bdead041d1fc478690d15cea49c68f8d4eb76","tarball":"https://registry.npmjs.org/window-resizeto/-/window-resizeto-0.0.1.tgz","fileCount":23,"unpackedSize":14414,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYj+NCRA9TVsSAnZWagAAccgP/2UqRMqjBxQPXBucfQmO\nxGH72IR2uzNIPTlz7wGIM2aj2S9CEQvODuMDbzBeGagPktW3VL5PzQuK5ict\nloEYqJ14ROJOeNDHiVxRtNPuwLSkK7YrsEkX8gOcxxKzYAZCdd1gZWc2l8ZB\n9/ef25bNodp1We5rh/MqcM4c5nqzHLHHNF/sjwXdKjxmN6DDDVJhzKGuxat/\nV8nPXzVnBNc5ZLd9bJXcu3C5ZPV2AdR49al6heEdqo0eDtkZbgyIfj4S7RHk\n0j3hoMoJymJwqKfbOvSOQPe1+V+XfTVvn6/2nGmfuUFFbXs543qB4qGPHHDf\nr0jpHq/FHCA5XFiM1t1XaSr3jFeT9Bu1fkEd2Fqr8/32PWuBZbQ1qPnortkv\nEpL3gE1ZnePhEUIX/faU6Os3ndSfN6O8YGgdW3VGHaxZAnIIpmDkY/ndWrcn\n1tI2c4VUR5se5H38B9KyXCar+ggQuCjyiOPducOpFRcBmQPswv4SKckD+YvY\nhLp/f+EL3zvdhvITCFmlqIzV2Khye8Omq5yovqv4R8Z2AUh/cJoM4mUeTj/T\n22xElA7xoA0Bz70WxIhcWv+dVenZa8U1dCqOfQ361thqBVzyPeSw+OqX/oJV\nM3DcOIHRKL5a47G9WsVK7sWZIcjDhCEDeNER0+7pZ7oOSrS7jVSFqsepOnU7\ngogy\r\n=ayE0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICBEl1r/io2btALWk5eYAMy+TE9Nj8x5YNA0zUbBZeG1AiEA4CBnSSu9Dfg4AV5RMbVPeJY+Vhp9CCW3yXbHkdPsExE="}]},"maintainers":[{"name":"agilgur5","email":"agilgur5@gmail.com"}],"_npmUser":{"name":"agilgur5","email":"agilgur5@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/window-resizeto_0.0.1_1583497100658_0.7906903587069469"},"_hasShrinkwrap":false},"0.0.2":{"name":"window-resizeto","version":"0.0.2","description":"A window.resizeTo polyfill for test environments like Jest & JSDOM","main":"dist/index.js","module":"dist/index.esm.js","typings":"dist/index.d.ts","author":{"name":"Anton Gilgur"},"license":"Apache-2.0","homepage":"https://github.com/agilgur5/window-resizeto","repository":{"type":"git","url":"git+https://github.com/agilgur5/window-resizeto.git"},"bugs":{"url":"https://github.com/agilgur5/window-resizeto/issues"},"keywords":["window","resizeTo","resize","polyfill","ponyfill","jsdom","jest","test","testing"],"scripts":{"lint":"tsdx lint '**/*.ts'","lint:fix":"npm run lint -- --fix","build":"tsdx build --entry src/index.ts --entry src/polyfill.ts","test":"tsdx test","test:pub":"npm run build && npm pack","pub":"npm run build && npm publish","changelog":"changelog-maker"},"peerDependencies":{},"dependencies":{},"devDependencies":{"@agilgur5/changelog-maker":"^3.0.0","@babel/core":"^7.8.4","babel-eslint":"^10.0.2","eslint":"^6.8.0","eslint-config-standard-with-typescript":"^12.0.1","eslint-plugin-import":"^2.20.1","eslint-plugin-node":"^11.0.0","eslint-plugin-promise":"^4.2.1","eslint-plugin-react":"^7.18.3","eslint-plugin-standard":"^4.0.1","jest-without-globals":"^0.0.3","tsdx":"github:agilgur5/tsdx#dist-multi"},"gitHead":"bab290968f43ea9402288fe429fed07c30680b4d","_id":"window-resizeto@0.0.2","_nodeVersion":"10.16.0","_npmVersion":"6.13.1","dist":{"integrity":"sha512-681jdLyc6p+Whk7lFxWISm+V49ymURtBN+Oz5j5c6UnYoBpqc2Q8e3pjZ5VtedC01TjJqr2Xt9XdJMid4KxZmQ==","shasum":"94db61ea93e0bfc4292fd82c3e98b24776637bc5","tarball":"https://registry.npmjs.org/window-resizeto/-/window-resizeto-0.0.2.tgz","fileCount":23,"unpackedSize":14414,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYkRhCRA9TVsSAnZWagAABR4QAIB5IY0rQTwxhMoMOX7y\npadBrrrx4AkkJJI29QRjsz7lpYDTnMVEBvpdVG4RHBkmlzRfA0079sq9VCmy\ni58KpFuKKY9/a3RmPGRe3Nn/6RA0nUqp1kQfoZr1fYc+e5LSba9RaUXGB6iF\nKoz7/eHQpi/kxnG4IYU+Y2BACp/ZaJ9MgPCY2eCbwqY8Atw9O9DXbtIPBV58\npXH7rCA+nWH5VIHF44f9eEM/b6Rm8yvANmWhQNF1zdHtSZcw3MNwQmCRt7Of\nGShGffqMd4W79ubOJtwxeK0PRy6aRBd2cGVuBOaijHFlcMQgyDe6/7BirCjZ\n1+8ibo9Y3r6jD2AprLpJ4bw3MmYEwsqeS5Rosvn6F0+6MccAqC0nxgM6olEa\nnuJAimdwumTQiFofrkmchrCXBd3x4P4Cfe+AlafHgZB1OL4DKNUNfMWegPFE\nRBPs4q/rTM3E8Beo4HZ1LKVhG3Clb2lNrZIzbRMvmoJtfB17jLQIwPgly6YP\n43NxmNHOvOIJB7pn4RtxpUzkDHRa5j5CN7I7losTFCByKBNCLB2rb71lHqYj\nUYqbrTt8MI8zf9DLN+LL9hd8nbqJeUGuhxe9HeD/wSjbPa8aZw6bIDdT4jl7\nv4RWwMP7p6SKvF+FMtgSWbEDaPlS/P9n9tlPWGB1hO1bGRx/nQSmbbpUDoGG\ne/ve\r\n=nSDj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD6WyTeILT/VasUvsPbRg7GDC1pwdD1/SsTPZDLLbTf5QIgfL9AKO5iweo/G747sfAlLDJCaTu1EEd+SUhpZ4uCmyU="}]},"maintainers":[{"name":"agilgur5","email":"agilgur5@gmail.com"}],"_npmUser":{"name":"agilgur5","email":"agilgur5@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/window-resizeto_0.0.2_1583498337246_0.7456545503421399"},"_hasShrinkwrap":false}},"time":{"created":"2020-03-06T12:18:20.658Z","0.0.1":"2020-03-06T12:18:20.780Z","modified":"2022-05-24T12:43:17.112Z","0.0.2":"2020-03-06T12:38:57.344Z"},"maintainers":[{"name":"agilgur5","email":"agilgur5@gmail.com"}],"description":"A window.resizeTo polyfill for test environments like Jest & JSDOM","homepage":"https://github.com/agilgur5/window-resizeto","keywords":["window","resizeTo","resize","polyfill","ponyfill","jsdom","jest","test","testing"],"repository":{"type":"git","url":"git+https://github.com/agilgur5/window-resizeto.git"},"author":{"name":"Anton Gilgur"},"bugs":{"url":"https://github.com/agilgur5/window-resizeto/issues"},"license":"Apache-2.0","readme":"# window-resizeto\n\n<!-- releases / versioning -->\n[![package-json](https://img.shields.io/github/package-json/v/agilgur5/window-resizeto.svg)](https://npmjs.org/package/window-resizeto)\n[![releases](https://img.shields.io/github/tag-pre/agilgur5/window-resizeto.svg)](https://github.com/agilgur5/window-resizeto/releases)\n[![commits](https://img.shields.io/github/commits-since/agilgur5/window-resizeto/v1.0.3.svg)](https://github.com/agilgur5/window-resizeto/commits/master)\n<br><!-- downloads -->\n[![dt](https://img.shields.io/npm/dt/window-resizeto.svg)](https://npmjs.org/package/window-resizeto)\n[![dy](https://img.shields.io/npm/dy/window-resizeto.svg)](https://npmjs.org/package/window-resizeto)\n[![dm](https://img.shields.io/npm/dm/window-resizeto.svg)](https://npmjs.org/package/window-resizeto)\n[![dw](https://img.shields.io/npm/dw/window-resizeto.svg)](https://npmjs.org/package/window-resizeto)\n<br><!-- status / activity -->\n[![typings](https://img.shields.io/npm/types/window-resizeto.svg)](https://github.com/agilgur5/window-resizeto/blob/master/src/index.tsx)\n[![build status](https://img.shields.io/travis/agilgur5/window-resizeto/master.svg)](https://travis-ci.org/agilgur5/window-resizeto)\n[![code coverage](https://img.shields.io/codecov/c/gh/agilgur5/window-resizeto/master.svg)](https://codecov.io/gh/agilgur5/window-resizeto)\n<br>\n[![NPM](https://nodei.co/npm/window-resizeto.png?downloads=true&downloadRank=true&stars=true)](https://npmjs.org/package/window-resizeto)\n<br>\nA [`window.resizeTo`](https://developer.mozilla.org/en-US/docs/Web/API/Window/resizeTo) polyfill for test environments like Jest & JSDOM.\n\n## Installation\n\n`npm i -D window-resizeto`\n\n## Usage\n\nThere are a few different ways you can use `window-resizeto`:\n\n- With Jest:\n\n  ```javascript\n  // jest.config.js\n  module.exports = {\n    setupFilesAfterEnv: [\n      // polyfill window.resizeTo\n      'window-resizeto/polyfill'\n    ]\n  }\n  ```\n\n  ```javascript\n  // some-test.spec.js\n  window.resizeTo(500, 500)\n  // window is now resize to 500x500\n  ```\n\n- Standalone with the polyfill:\n\n  ```javascript\n  import 'window-resizeto/polyfill'\n\n  window.resizeTo(500, 500)\n  // window is now resized to 500x500\n  ```\n\n- With the ponyfill:\n\n  ```javascript\n  import { resizeTo } from 'window-resizeto'\n\n  resizeTo(window, 500, 500)\n  // window is now resized to 500x500\n  ```\n\n## How it works\n\nBasically just sets the `window`'s `outerWidth`, `outerHeight`, `innerWidth`, `innerHeight`, and fires a `resize` event.\nThe source code is currently just <10 LoC, so [take a look under the hood](./src/)! :)\n\n## Credits\n\nInspiration for creating this came from [`mq-polyfill`](https://github.com/bigslycat/mq-polyfill) and a few [other](https://spectrum.chat/testing-library/help-react/how-to-set-window-innerwidth-to-test-mobile~70aa9572-b7cc-4397-92f5-a09d75ed24b8?m=MTU1OTU5MTI2MTI0MQ==) code samples that are nearly exact replicas.\nI wanted a package I could re-use in my projects' tests instead of having to constantly create a helper file, and so `window-resizeto` was born!\n","readmeFilename":"README.md"}