{"name":"compression-streams-polyfill","description":"Lightweight polyfill/ponyfill for the Compression Streams API","version":"0.1.3","author":{"name":"Arjun Barrett","email":"arjunbarrett@gmail.com"},"main":"lib/index.js","types":"lib/global.d.ts","unpkg":"umd/index.js","jsdelivr":"umd/index.js","module":"esm/index.mjs","exports":{".":{"types":"./lib/global.d.ts","import":"./esm/index.mjs","require":"./lib/index.js"},"./ponyfill":{"types":"./lib/ponyfill.d.ts","import":"./esm/ponyfill.mjs","require":"./lib/ponyfill.js"}},"license":"MIT","homepage":"https://github.com/101arrowz/compression-streams-polyfill","repository":{"type":"git","url":"git+https://github.com/101arrowz/compression-streams-polyfill.git"},"bugs":{"url":"https://github.com/101arrowz/compression-streams-polyfill/issues","email":"arjunbarrett@gmail.com"},"keywords":["compression","streams","polyfill","ponyfill","web-streams","compression-streams","compression-streams-api","zlib","gzip","deflate"],"scripts":{"build":"tsc && tsc -p tsconfig.esm.json && node scripts/postbuild && yarn build:umd","build:umd":"microbundle -i src/index.ts -o umd/index.js --no-pkg-main -f umd --external none --no-sourcemap","prepack":"yarn build"},"dependencies":{"fflate":"^0.7.4"},"devDependencies":{"microbundle":"^0.15.1","typescript":"^4.9.3"},"gitHead":"20efc19b1c32a32c537c39dc556e28abf14a9deb","_id":"compression-streams-polyfill@0.1.3","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-FOvusJGoWTKRb9JNMtCc42C81SdyJhJws/lbExADOkH1R8KpdzY4yFO6953lW5Vw498pnGXoyosr807KTr8BAA==","shasum":"e2544e04dd4cd65cb63d130323f3177ec43ca47a","tarball":"http://registry-npm.ywwl.com/compression-streams-polyfill/download/compression-streams-polyfill-0.1.3.tgz","fileCount":17,"unpackedSize":35570,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFwojip50RkGInwDM/dD0Rw4Y7p8rTbwy4lbRqmtNY0iAiEA0hbgbpHhyiLhf8WlvTNwmHMh2tOCW2x/EOFN/I44hAk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjjB7lACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmor7w//TppleAfPI6hLT4Svq9RtYa/FttM3UDU2RgAm0nk+NX3HELgC\r\nZyDlPXVCgFNBAJKEvF20GHWdX1bReMh0sb9de6iFNm13jYlTNLebRK+9Zkmn\r\nxpprBo8K6R6GB1KyO0EjAhic79yx431pRj2RnP4ulF3dVdNEI09OLBOzfcRy\r\nusVDgMtpRlHyGV592fatM8hECkxalOUti61SynJK2vSIaQzCkJ0Tk8X8YSsi\r\ndp5+Tm0XF+Cnoohy0UarSoQZDJYO7odX4Y50JNWKiERIbrF9ECFRbZMSBZsV\r\nmNCPCzpWYqUPPaBq7lXV9gA2/sdJ/MJT2hlPPKus3MpgIe/U6BBFxeUX/vVa\r\n7EayseGXNp0ZmK1Xukalj7sqy1KEJ7uUu5ep8HWVQH7+T7GzZ2Ssbm0RgmBV\r\no/QuQF3gdlzD9ARElhD7WUs1HBMmzzyxKe/hQa6EcaiGNYbxZ8b9F+JpN3BI\r\nLq2aEnfmjS2otqpPeA1cch+0UTvu4U6ETdZ5Lc9KZbE/98QLFqHMlb/VgdsD\r\nzF3TDo0B3wSNbkPsiI36EpIIJW8XEG5iKNl48m2Wcy6MLlTzul5T1LSq+/qe\r\nMO5UGGgmJkKV/jLQyfctwVTspOJLCQy0mEb9CBJ1Xg9xRzmOlzq1IGpB8VbV\r\ng6k6WwsW+rIqvWYbH9w/eZrhQrxFb6rIk4E=\r\n=Xgro\r\n-----END PGP SIGNATURE-----\r\n","size":9675,"noattachment":false,"key":"/compression-streams-polyfill/-/compression-streams-polyfill-0.1.3.tgz"},"_npmUser":{"name":"101arrowz","email":"arjunbarrett@gmail.com"},"directories":{},"maintainers":[{"name":"101arrowz","email":"arjunbarrett@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/compression-streams-polyfill_0.1.3_1670127332853_0.25078571939444516"},"_hasShrinkwrap":false,"readme":"# compression-streams-polyfill\nLightweight polyfill/ponyfill for the Compression Streams API\n\n## Usage\n\nInstall:\n```sh\nnpm i compression-streams-polyfill # or yarn add, or pnpm add\n```\n\nImport:\n```js\nimport 'compression-streams-polyfill';\n// CompressionStream and DecompressionStream are now available\n```\n\nIf your environment doesn't support ES Modules:\n```js\nrequire('compression-streams-polyfill');\n```\n\nIf you want to load from a CDN in the browser:\n\n```html\n<!--\nYou should use either UNPKG or jsDelivr (i.e. only one of the following)\nYou can specify the version, e.g. with compression-streams-polyfill@0.1.4\n-->\n<script src=\"https://unpkg.com/compression-streams-polyfill\"></script>\n<script src=\"https://cdn.jsdelivr.net/npm/compression-streams-polyfill\"></script>\n```\n\n### Ponyfill usage\n\nThis polyfill is almost perfectly spec-compliant. Nonetheless, if you'd like to avoid adding `CompressionStream` and `DecompressionStream` to the global scope, you can use the [ponyfill](https://github.com/sindresorhus/ponyfill).\n\nNote that you must supply your own `TransformStream` implementation to use the ponyfill (though `TransformStream` is available in most modern browsers). \n```js\nimport { makeCompressionStream, makeDecompressionStream } from 'compression-streams-polyfill/ponyfill';\n\n// If you'd like to also ponyfill TransformStream:\n// import { TransformStream } from 'web-streams-polyfill/ponyfill';\n\nconst CompressionStream = makeCompressionStream(TransformStream);\nconst DecompressionStream = makeDecompressionStream(TransformStream);\n```\n\n## Performance and size\nThis polyfill is based on [fflate](https://github.com/101arrowz/fflate) and is therefore very fast. It tends to be between 20% slower and 5% faster than Chromium's native `CompressionStream` and `DecompressionStream`. The `CompressionStream` polyfill also yields similar compression ratios to the native implementation.\n\nThe polyfill's full bundle size is about 17kB minified, or 7kB gzipped.\n\n## License\nMIT","publish_time":1670127333035,"_cnpm_publish_time":1670127333035,"dist-tags":{"latest":"0.1.7"}}