{"name":"compression-streams-polyfill","description":"Lightweight polyfill/ponyfill for the Compression Streams API","version":"0.1.6","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 && npm run build:umd","build:umd":"microbundle -i src/index.ts -o umd/index.js --no-pkg-main -f umd --external none --no-sourcemap","prepack":"npm run build"},"dependencies":{"fflate":"^0.8.0"},"devDependencies":{"microbundle":"^0.15.1","typescript":"^4.9.3"},"gitHead":"b7f5f67e6825540cd0e1bcd334e6abdf0c0f3c26","_id":"compression-streams-polyfill@0.1.6","_nodeVersion":"18.17.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-vYXHeCzZPfKqz/ppInffY2HkevGbV6zm5wlSgtrW0+6neApbA5qZdG48KaDEhRmbIFhLgmVUlUc+szH9NrcaBA==","shasum":"4e0f8cee8b035df1f4fafb045dfda0624ead4165","tarball":"http://registry-npm.ywwl.com/compression-streams-polyfill/download/compression-streams-polyfill-0.1.6.tgz","fileCount":18,"unpackedSize":42184,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE2E2bpjcboU/ww7hzluGYCOgYicmW3baueS3KUzWNHJAiEA4PfMVoZwCNcMpXr1oiQlmqVn/7xsc2L/mkB6IlmfzFo="}],"size":11420,"noattachment":false,"key":"/compression-streams-polyfill/-/compression-streams-polyfill-0.1.6.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.6_1695476764522_0.2945159548023095"},"_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":1695476764768,"_cnpm_publish_time":1695476764768,"dist-tags":{"latest":"0.1.7"}}