{"name":"@reach/observe-rect","version":"1.0.1","description":"Observe the Rect of a DOM element.","scripts":{"build":"microbundle","start":"microbundle watch"},"files":["src","dist","README.md"],"main":"dist/index.js","umd:main":"dist/index.umd.js","module":"dist/index.m.js","source":"src/index.js","repository":{"type":"git","url":"git+https://github.com/reach/rect-observer.git"},"author":{"name":"Ryan Florence","email":"@ryanflorence"},"license":"MIT","dependencies":{},"devDependencies":{"babel-preset-env":"^1.7.0","eslint":"^4.19.1","eslint-config-prettier":"^2.9.0","eslint-plugin-jest":"^21.17.0","microbundle":"^0.4.4","serve":"^7.2.0"},"prettier":{},"gitHead":"46760f8fb04f8759877d6658fd79caf41f7b8e08","bugs":{"url":"https://github.com/reach/rect-observer/issues"},"homepage":"https://github.com/reach/rect-observer#readme","_id":"@reach/observe-rect@1.0.1","_npmVersion":"6.1.0","_nodeVersion":"8.4.0","_npmUser":{"name":"ryanflorence","email":"rpflorence@gmail.com"},"dist":{"integrity":"sha512-vtiZleuDsxZyQTTKlHJLgNGmhAdZ2TKVLkWcxZVgFMRPMecol15TQY4sCkpjng+RkFYvoPysmi0KyZ36VJ7Fjg==","shasum":"d2beb257ec908c833b5bb6bc79daf5f56021ec1d","tarball":"http://registry-npm.ywwl.com/@reach/observe-rect/download/@reach/observe-rect-1.0.1.tgz","fileCount":10,"unpackedSize":26798,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbE3zOCRA9TVsSAnZWagAAv1AP/iIdqWVKNKX7MuGcKWDm\nriJDgFApA4pHuXS7/uvglm25TZPVF4NY38eIz9pg3wInRda5COPJ6HD8FFwN\nLTX88PdEA9gaYYkRcu92pXV0ltuHbzYnguhwPNoeUPyQbu8uQs1LRu61cnds\nSTwlxI2+rSEPTrYAMaHTaKSI7/P7BpESNRn6EEACS26prgdAQj5JtpFO0WcM\n7bfbqaNse618SZD7tJC4nMH4YEnCCPdRovSeEysHRZFPVisnhv/tgIfvtkJL\n8cDyqebtredFEH1Pv6/4xmt5guQT9xVgZXaf8ikthey7DRStpZuT8NqQ/l/k\nQgmNmkqnwTA6ZjBGhsU707l/WfoeMFeFvTdjn6ZHi9821JCNHhisCt4QZJB7\nqIbO5s8Fh+CawWADFi2hn4QXlKuCyQnHX3z8JUG3t2TBHfRKQ7LppmjkbNC4\ncjf2k7eexZ89GS3J7vGYABfFQt9xdKuKmiGjjq9RpkcxC1q3xZ9G7GKPgRRQ\nNTYTUqKx0EdphOeD9eFqwzmznkf28ykeYZhwyjb7EyoIfttIjuZKAQmlJMwB\n0b/1SwbH46G1iq88V5XgI7SFcA2Wuh0nP47iU7pxFk+5HTApP0giBP89+t1L\nPyy+tt9x6BQV6+Ni9/xAydDH+86cYH/MxsupN0d5rLdw5rF3uKyRjJRWbKlS\nzIlE\r\n=f9eV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDE4R7m9d4s1Wr3l9IcDD5V34yK5oxJIWf1EpDDqHCkbAiEAtnWVJyYcoWlTLqO89ElMlWp/sM3uiUBnBJ8f1UNwg4E="}],"size":3865,"noattachment":false,"key":"/@reach/observe-rect/-/@reach/observe-rect-1.0.1.tgz"},"maintainers":[{"name":"ryanflorence","email":"rpflorence@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/observe-rect_1.0.1_1528003789448_0.29134916634878993"},"_hasShrinkwrap":false,"readme":"<p align=\"center\">\n  <a href=\"https://reach.tech\">\n    <img alt=\"Reach observeRect\" src=\"./logo.png\" width=\"400\">\n  </a>\n</p>\n\n<p align=\"center\">\n  Observe the rect of a DOM element.\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/@reach/observe-rect\"><img src=\"https://img.shields.io/npm/v/@reach/observe-rect.svg?style=flat-square\"></a>\n  <a href=\"https://www.npmjs.com/package/@reach/observe-rect\"><img src=\"https://img.shields.io/npm/dm/@reach/observe-rect.svg?style=flat-square\"></a>\n</p>\n\n<p align=\"center\">\n  <img src=\"./demo.gif\" alt=\"Demo\"/>\n</p>\n\n## Installation\n\n```\nnpm install @reach/observe-rect\n# or\nyarn add @reach/observe-rect\n```\n\n## Usage\n\n```js\nimport observeRect from \"@reach/observe-rect\";\n\nlet node = document.getElementById(\"some-node\");\n\nlet rectObserver = observeRect(node, rect => {\n  console.log(\"left\", rect.left);\n  console.log(\"top\", rect.top);\n  console.log(\"height\", rect.height);\n  console.log(\"width\", rect.width);\n});\n\n// start observing\nrectObserver.observe();\n\n// stop observing\nrectObserver.unobserve();\n```\n\n## About\n\nA lot of things can change the position or size of an element, like scrolling, content reflows and user input. This utility observes and notifies you when your element's rect changes.\n\n## Legal\n\nMIT License\nCopyright (c) 2018-present, Ryan Florence\n","publish_time":1528003789528,"_cnpm_publish_time":1528003789528,"dist-tags":{"latest":"1.2.0"}}