{"name":"compression-streams-polyfill","description":"Lightweight polyfill/ponyfill for the Compression Streams API","version":"0.1.0","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":"fc51668f97373db4839a4e1ca2b3abda565c6e71","_id":"compression-streams-polyfill@0.1.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-+jvN9RI4aXWue01XI3RkXtwasAZJ42UxQ/d894RL3537/yR/IDJy6ID04KSp/9sJm5BjEv8x1IkGd2UsG/dJgg==","shasum":"9887503d842a51d2dfdd7004c0fb38994d7750dd","tarball":"http://registry-npm.ywwl.com/compression-streams-polyfill/download/compression-streams-polyfill-0.1.0.tgz","fileCount":3,"unpackedSize":4016,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDfdzSfiNLudUg7GTdcqsvyfYp7nV0Zi2RqhUTMwSUBbQIgCjadrNxVbM7ssgV4QywUiQC5idh+pBQzL1D9v6jvjLA="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhXJzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoBcw//c1Wsq0AKggUb41DxrtvweLfxvRLj/mjIpocQBkiLQXEVliRf\r\ndfaIsKX6B3A8c3xxgA/DQwOR6ltUNFPwcg0G9F7zv5H4U/55OglnMOpy3p/0\r\nlyo9SB6c1ZzJc9EZ1Ztxyt7Dbr+cWpFEX8qBLeFIFz2xiQQBy39evZ0RcusP\r\nlNy9Z4DutDYo3+4x3HRiQy9484LR1pP4EpIVPRv0C7EpsfpX9ikCKr/7JX2B\r\noQrFrcYPFhezN3ns+uQf+gOZ8NEdjTg+EtqfUID58D+Bbpji/Ry1VJg1k7pQ\r\n1vEONfFGuSk6ggz197GnRosPsUutwSFJYkD8fhzJM4jckm7039/EvBkgWQHu\r\n9/98XHV/TvlwAS0Yy8oQDA3jtjAMZvPxK4kWoe6tctVu5GdLq3V1G6FCnoVA\r\nLCtr4nXfxUUwzhVe9ItUveRlEtyv5odIWFg5WMnFzIA49kIDai7xKU3qeRmS\r\nf+gS/ZPqfjKV4qYQ12CpnX+8prAisS7z9iKdOAo9zNpwV7CDiZw7Ab9NIZoG\r\nOTTzS1WXtU7z2miRA0G+ma+D6w2mC5pXxy73xWoxInybQoSbkapu78qa3aRT\r\nZcVgWYoQXKpNDbzODjyCjkg6XaTDnq9AWBl1415UbXTUSfqY6THEZuD5rh4I\r\n0SbGrpxHBSyTnRLKiJG8E99dayp9aWpcBlE=\r\n=M9S0\r\n-----END PGP SIGNATURE-----\r\n","size":1625,"noattachment":false,"key":"/compression-streams-polyfill/-/compression-streams-polyfill-0.1.0.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.0_1669689970934_0.6040244168447073"},"_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":1669689971099,"_cnpm_publish_time":1669689971099,"dist-tags":{"latest":"0.1.7"}}