{"name":"compression-streams-polyfill","description":"Lightweight polyfill/ponyfill for the Compression Streams API","version":"0.1.1","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":"831b07d662e7e9040f711e72284b3023454a01ce","_id":"compression-streams-polyfill@0.1.1","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-SMWu7eAqeYr1AizMBxRn8WmHFAJr3fxPY+Jio0QqvFg9CnV1YEcs6lUoUHSrrY3f2o6llXuEoIi/J+nhH+LyEg==","shasum":"062c48df717ca4e84fa510609fb80181cacfab44","tarball":"http://registry-npm.ywwl.com/compression-streams-polyfill/download/compression-streams-polyfill-0.1.1.tgz","fileCount":17,"unpackedSize":33502,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDHFJxguxlsZ8jhXdx9vYcRdm+SsGCe7LZBr83LV1keTQIhAPxR+IGVaG5nrl2LUmxIpWbqduCcftHUdjFyU71czDv8"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhXKvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpT4w//ZME7VR/dr3AOTZOhVntRsrTT+VJAiNqp2arGszL/aQxDGDWF\r\nGGLpn3tLYeJZO6glgbgYCXk7FAMDeC7tns5Z8EMEBz+MAJqelRIOoLvjuQKj\r\nWcbqqluJI2DCBiEq+T3eOd5TIKg8PhYJ9VxfZN9NdNNBIOmhde4mTPDoHP5C\r\nvjZpCVArLjksxBZRF25UuprWIqyTgNv7e8qpRJbppRbFHGkVyL60KOErOESt\r\nwke38mKJA1WsNlQ+iBydUIZXXw20PLkdH4NI5LFDd04d+mpXt9287irATdFf\r\nPuLbrjHWPUpZDy4LH1Ad4VX6PZ9PgZdrI4ll2o5Pm/fnrGOeEJviqNayh7nx\r\nR5HN8jtGBXkC5QkC+qXvWntW5wKXwjRTQUDx75m3sHawj2dcL0wQAPwAWc2Q\r\naDBoI6Jmm9IU0pU7DiDlRKDpJBckKqQZXDLJ96ICAyd03ti5LPanVNKJ2Pze\r\ndsH7b78eyJH3FtgCkjlLHTDdb5rtpcoiHPCz6/aEAI6Zg6YiTYOfheeenq6z\r\ngkm0vOJfHR5hxpsshiVe0xQiJsgmpVBb5YB8MCjfloIQwha4axH9JuG24kc8\r\nvExiOhrWJkjjhSKn8z23C+RjRLbYsOGtBnXEBAKHfg+iOpN9w9ClI8XYUQzf\r\n+RmXxuIIP+Q5r8wbL5u+BccizxKWdMYo+to=\r\n=fSC8\r\n-----END PGP SIGNATURE-----\r\n","size":9434,"noattachment":false,"key":"/compression-streams-polyfill/-/compression-streams-polyfill-0.1.1.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.1_1669690031661_0.5148870167566744"},"_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":1669690031832,"_cnpm_publish_time":1669690031832,"dist-tags":{"latest":"0.1.7"}}