{"name":"compression-streams-polyfill","description":"Lightweight polyfill/ponyfill for the Compression Streams API","version":"0.1.2","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":"9674c34a1d439eedbecb9fba6af58c4baf4c4d63","_id":"compression-streams-polyfill@0.1.2","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-cDna/E98mnqhpEmeC+ggwxkoD+z3k/SjUAxzHRI8WHBC4k4NiHZnmSELhkvjYo1yQDj3kK05T5xhqqXWOABN9Q==","shasum":"5edd2ac76f50c94880d0d1f940574e36d6f418bb","tarball":"http://registry-npm.ywwl.com/compression-streams-polyfill/download/compression-streams-polyfill-0.1.2.tgz","fileCount":17,"unpackedSize":35558,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD65BQsU+NuZ+T1h/GYmOHA44jHU5SSTQOIILlkDJCJPQIhAKLSvR1NcOguO1eLmPA87+BkN+6Ul4tdwbxY3SdhAguo"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjjAp2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoT1g/8DTgT8s5Z4sRoNBPCNlzYwE3oLEWLVqfAITD/5tsM2d+t0Gs3\r\nSbxJr5agoDqpGfA8BjPxRQlOYPkFCGZQA/Ym/eSgGGajD6sZFtKxIp0knR7P\r\nbbDVMfrvJcb8oWXFgXauPDLG9QR/BkD85pcTC0hOQgWIliFA4+wnLSw8IIu2\r\njYNTO+VPW7cdsEIpa47RcyJP4rGdsqT9txgdoyx3xfmvjpdEtrcpmikvGpHj\r\nhLoonDnvRfRr/csiTneMcUXgDqRKXw+IQlErDD9S9bYAYN5dGfTLxS9qoPyX\r\nCdtm1HPYfPP0Nk6d7+su4QWUUoyWsoGpYCoMNHO6XgHVT9AKgq6Q0E4PBL0e\r\nyAmUb8vBINBrzUUnfNlh58pP1DpJGD6eXyEUEwEkSvEyGaG25pBAa8Jp85fL\r\n/gWzIJaAGNcVJd5E7Ur2ZsHCvMt/Ax2rbDVBn5pPfXRokd2bxfwgppXU5AN8\r\nwoogBfaFdKec1S5uuRnOchqV1BPLuuDw6pE4ScuQNSH62dWTxeNHStdf0T+C\r\n19KvKwJY5p49YBs6/ENo9JzltrO79x9m6Eu7jbldpBJyvdB9ay9i3pArTSPy\r\nzT6AxJuDFIwn7gDmJ1OpzYMaHvM7ZViBW6wzJaXgmt+yd4AMlrwMdbYxpwQv\r\nRG8IGNwdzLQk7RCnUbAAKDzl7lQSuJnp6js=\r\n=i5C/\r\n-----END PGP SIGNATURE-----\r\n","size":9671,"noattachment":false,"key":"/compression-streams-polyfill/-/compression-streams-polyfill-0.1.2.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.2_1670122102060_0.7064606215777955"},"_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":1670122102251,"_cnpm_publish_time":1670122102251,"dist-tags":{"latest":"0.1.7"}}