{"bugs":{"url":"https://github.com/withastro/astro/issues"},"dist":{"shasum":"8f70f98396b43a87a81e6a13d38f904b522ddf72","tarball":"https://registry.npmjs.org/@astrojs/webapi/-/webapi-2.0.0-beta.0.tgz","fileCount":7,"integrity":"sha512-f9ukaJK44/XFegOBrGVXt1lHz1ejoa8cWXtfZ5ZdZqt4PabhinOkmFTdmKQXtsUhc4EbUU1di38XqgY8zg/YHg==","signatures":[{"sig":"MEUCIQCdnYUHDBWWTj0jUFyUgB4un0LfE1fO1HBHtMwlr46j6QIgOEAQf1lcoZfVt8nWHP9VhF7aHd5wtoZRPVxDohCXdzE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":370295,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjwDibACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmryjBAAmPJd0aetSTyFHLWPHgAxJLjTzwM2Jun+OAFyol3xie7Y2GC/\r\nSZRxvaR7se1asJMeZxuh4IP6V13mBjGQ/dHE+rN4z5wOuRcjct9JnVuSFnjC\r\n7e8GdvpMYr907/R9A6j1T5OI1B7R5eyrvE+Rpo7/5ZDHQC0CZhHMLLFa8GnH\r\n+ONMWA3379y03mlEcaxAQ2iT/ONb6hEkawMLqF8DIw59UNSQbTxBlHsqVAiB\r\nVovNwEIBzEikMJRjo4BfWneu5YlzZIHsqojhxyCQ5uHQKkjoBXoG5qoUn4Gl\r\nZ9A1yyK64EOulfVpMBHvBGTtriyiCzKjbuTsSmA9r6jugP6W8wRerozbfw1E\r\nvW3U3fj2VfVHygKpI70Nk0X9oALljaJ10yU3MQSHi7F1NlX8BIIJVygV+TYM\r\nJmA5z/vpv1ywB0N/xNemuxn9YccAS69v6LIfC4x0CUH9d8QzYUNPy5CMhgQw\r\nbRKIYFRqBeiuA4ASQH/nxsjnIcA4p7tyqe/PNMbroHi4TYjcFdmBSZLtM3zg\r\nMTQfW14IGHwt5yQhWrcH7XT1Gfa8HVnSq+P1JNhQrBamEIKHG+gST8WgguJc\r\nG7327GqTEqXmX4VTUIs2V9pid36gAnWLBoVSsyV5+8gkvodhnxAvkIjy2LjN\r\nBWd+WqExm9SIVZp6KpUF51voFfZfxjs2HGA=\r\n=rbLx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"mod.js","name":"@astrojs/webapi","type":"module","_from":"file:astrojs-webapi-2.0.0-beta.0.tgz","types":"mod.d.ts","author":{"name":"withastro"},"readme":"# WebAPI\n\n**WebAPI** lets you use Web APIs not present in Node v16 and later.\n\n```sh\nnpm install @astrojs/webapi\n```\n\n```js\nimport { polyfill } from '@astrojs/webapi'\n\npolyfill(globalThis)\n\nconst t = new EventTarget()\nconst e = new CustomEvent('hello')\n\nt.addEventListener('hello', console.log)\n\nt.dispatchEvent(e) // logs `e` event from `t`\n```\n\nThese APIs are combined from popular open source projects and configured to share implementation details. This allows their behavior to match browser expectations as well as reduce their combined memory footprint.\n\n## Features\n\n- [ByteLengthQueuingStrategy](https://developer.mozilla.org/en-US/docs/Web/API/ByteLengthQueuingStrategy)\n- [CanvasRenderingContext2D](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D)\n- [CSSStyleSheet](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet)\n- [CountQueuingStrategy](https://developer.mozilla.org/en-US/docs/Web/API/CountQueuingStrategy)\n- [CustomElementRegistry](https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry)\n- [CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent)\n- [DOMException](https://developer.mozilla.org/en-US/docs/Web/API/DOMException)\n- [Document](https://developer.mozilla.org/en-US/docs/Web/API/Document)\n- [DocumentFragment](https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment)\n- [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element)\n- [Event](https://developer.mozilla.org/en-US/docs/Web/API/Event)\n- [EventTarget](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget)\n- [File](https://developer.mozilla.org/en-US/docs/Web/API/File)\n- [FormData](https://developer.mozilla.org/en-US/docs/Web/API/FormData)\n- [HTMLDocument](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDocument)\n- [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement)\n- [HTMLBodyElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLBodyElement)\n- [HTMLCanvasElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement)\n- [HTMLDivElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDivElement)\n- [HTMLHeadElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLHeadElement)\n- [HTMLHtmlElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLHtmlElement)\n- [HTMLImageElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement)\n- [HTMLSpanElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLSpanElement)\n- [HTMLStyleElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLStyleElement)\n- [HTMLTemplateElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTemplateElement)\n- [HTMLUnknownElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLUnknownElement)\n- [Headers](https://developer.mozilla.org/en-US/docs/Web/API/Headers)\n- [IntersectionObserver](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver)\n- [Image](https://developer.mozilla.org/en-US/docs/Web/API/Image)\n- [ImageData](https://developer.mozilla.org/en-US/docs/Web/API/ImageData)\n- [MediaQueryList](https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList)\n- [MutationObserver](https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver)\n- [Node](https://developer.mozilla.org/en-US/docs/Web/API/Node)\n- [NodeIterator](https://developer.mozilla.org/en-US/docs/Web/API/NodeIterator)\n- [OffscreenCanvas](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas)\n- [ReadableByteStreamController](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController)\n- [ReadableStream](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream)\n- [ReadableStreamBYOBReader](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader)\n- [ReadableStreamBYOBRequest](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBRequest)\n- [ReadableStreamDefaultController](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController)\n- [ReadableStreamDefaultReader](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader)\n- [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request)\n- [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response)\n- [ShadowRoot](https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot)\n- [Storage](https://developer.mozilla.org/en-US/docs/Web/API/Storage)\n- [StyleSheet](https://developer.mozilla.org/en-US/docs/Web/API/StyleSheet)\n- [TransformStream](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream)\n- [TreeWalker](https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker)\n- [WritableStream](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream)\n- [WritableStreamDefaultController](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultController)\n- [WritableStreamDefaultWriter](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter)\n- [Window](https://developer.mozilla.org/en-US/docs/Web/API/Window)\n- [cancelAnimationFrame](https://developer.mozilla.org/en-US/docs/Web/API/Window/cancelAnimationFrame)\n- [cancelIdleCallback](https://developer.mozilla.org/en-US/docs/Web/API/cancelIdleCallback)\n- [clearTimeout](https://developer.mozilla.org/en-US/docs/Web/API/clearTimeout)\n- [fetch](https://developer.mozilla.org/en-US/docs/Web/API/fetch)\n- [localStorage](https://developer.mozilla.org/en-US/docs/Web/API/localStorage)\n- [requestAnimationFrame](https://developer.mozilla.org/en-US/docs/Web/API/requestAnimationFrame)\n- [requestIdleCallback](https://developer.mozilla.org/en-US/docs/Web/API/requestIdleCallback)\n- [setTimeout](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout)\n- [structuredClone](https://developer.mozilla.org/en-US/docs/Web/API/structuredClone)\n- [URLPattern](https://developer.mozilla.org/en-US/docs/Web/API/URLPattern)\n\n## Usage\n\nYou can use WebAPIs as individual exports.\n\n```js\nimport { Event, EventTarget, File, fetch, Response } from '@astrojs/webapi'\n```\n\nYou can apply WebAPIs to an object, like `globalThis`.\n\n```js\nimport { polyfill } from '@astrojs/webapi'\n\npolyfill(globalThis)\n```\n\n## Polyfill Options\n\nThe `exclude` option receives a list of WebAPIs to exclude from polyfilling.\n\n```js\npolyfill(globalThis, {\n\t// disables polyfills for setTimeout clearTimeout\n\texclude: 'setTimeout clearTimeout',\n})\n```\n\nThe `exclude` option accepts shorthands to exclude multiple polyfills. These shorthands end with the plus sign (`+`).\n\n```js\npolyfill(globalThis, {\n\t// disables polyfills for setTimeout clearTimeout\n\texclude: 'Timeout+',\n})\n```\n\n```js\npolyfill(globalThis, {\n\t// disables polyfills for Node, Window, Document, HTMLElement, etc.\n\texclude: 'Node+',\n})\n```\n\n```js\npolyfill(globalThis, {\n\t// disables polyfills for Event, EventTarget, Node, Window, Document, HTMLElement, etc.\n\texclude: 'Event+',\n})\n```\n\n| Shorthand      | Excludes |\n|:-------------- |:-------- |\n| `Document+`    | `Document`, `HTMLDocument` |\n| `Element+`     | `Element`, and exclusions from `HTMLElement+` |\n| `Event+`       | `Event`, `CustomEvent`, `EventTarget`, `MediaQueryList`, `Window`, and exclusions from `Node+` |\n| `EventTarget+` | `Event`, `CustomEvent`, `EventTarget`, `MediaQueryList`, `Window`, and exclusions from `Node+` |\n| `HTMLElement+` | `CustomElementsRegistry`, `HTMLElement`, `HTMLBodyElement`, `HTMLCanvasElement`, `HTMLDivElement`, `HTMLHeadElement`, `HTMLHtmlElement`, `HTMLImageElement`, `HTMLStyleElement`, `HTMLTemplateElement`, `HTMLUnknownElement`, `Image` |\n| `Node+`        | `Node`, `DocumentFragment`, `ShadowRoot`, `Document`, `HTMLDocument`, and exclusions from `Element+` |\n| `StyleSheet+`  | `StyleSheet`, `CSSStyleSheet` |\n\n---\n\n\n\n## License & Attribution\n\nThank you to Jon Neal for his work on the original [webapi](https://github.com/astro-community/webapi) project that this package is forked from. Licensed under the CC0-1.0 License.\n\nCode from [event-target-shim](https://www.npmjs.com/package/event-target-shim) is licensed under the MIT License (MIT), Copyright Toru Nagashima.\n\nCode from [formdata-polyfill](https://www.npmjs.com/package/formdata-polyfill) is licensed under the MIT License (MIT), Copyright Jimmy Wärting.\n","exports":{".":{"types":"./mod.d.ts","import":"./mod.js"},"./apply":{"import":"./apply.js"}},"license":"MIT","scripts":{"dev":"node run/build.js","test":"mocha --parallel --timeout 15000","build":"node run/build.js","release":"node run/build.js && npm publish --access public","build:ci":"node run/build.js"},"_npmUser":{"name":"fredkschott","email":"fkschott@gmail.com"},"homepage":"https://github.com/withastro/astro/tree/main/packages/webapi#readme","keywords":["astro","api","cancelAnimationFrame","clearImmediate","clearInterval","fetch","requestAnimationFrame","setImmediate","setInterval","web"],"prettier":{"semi":false,"useTabs":true,"overrides":[{"files":[".stackblitzrc","*.json"],"options":{"useTabs":false}}],"singleQuote":true,"trailingComma":"es5"},"_resolved":"/tmp/0f6be829939f76adde0e33404cfa39d9/astrojs-webapi-2.0.0-beta.0.tgz","_integrity":"sha512-f9ukaJK44/XFegOBrGVXt1lHz1ejoa8cWXtfZ5ZdZqt4PabhinOkmFTdmKQXtsUhc4EbUU1di38XqgY8zg/YHg==","repository":{"url":"git+https://github.com/withastro/astro.git","type":"git","directory":"packages/webapi"},"_npmVersion":"8.19.3","description":"Use Web APIs in Node","directories":{},"maintainers":[{"name":"natemoo-re","email":"nate@natemoo.re"},{"name":"drewpowers","email":"drew@pow.rs"},{"name":"fredkschott","email":"fkschott@gmail.com"},{"name":"matthewp","email":"matthew@matthewphillips.info"}],"_nodeVersion":"16.19.0","contributors":[{"url":"https://github.com/jonathantneal","name":"Jonathan Neal"},{"url":"https://github.com/mysticatea","name":"Toru Nagashima"},{"url":"https://github.com/jimmywarting","name":"Jimmy Wärting"},{"url":"https://github.com/bitinn","name":"David Frank"},{"url":"https://github.com/MattiasBuelens","name":"Mattias Buelens"},{"url":"https://github.com/creatorrr","name":"Diwank Singh"}],"dependencies":{"undici":"^5.14.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.3.6","mocha":"^9.2.2","tslib":"^2.4.0","rollup":"^2.79.1","typescript":"~4.7.3","@types/chai":"^4.3.1","@types/node":"^14.18.21","@types/mocha":"^9.1.1","magic-string":"^0.25.9","event-target-shim":"^6.0.2","formdata-polyfill":"^4.0.10","urlpattern-polyfill":"^1.0.0-rc5","@rollup/plugin-alias":"^3.1.9","@rollup/plugin-inject":"^4.0.4","@ungap/structured-clone":"^0.3.4","@rollup/plugin-typescript":"^8.3.2","@rollup/plugin-node-resolve":"^13.3.0"},"_npmOperationalInternal":{"tmp":"tmp/webapi_2.0.0-beta.0_1673541787506_0.7951200621476247","host":"s3://npm-registry-packages"},"_id":"@astrojs/webapi@2.0.0-beta.0","version":"2.0.0-beta.0"}