{"name":"pako","description":"zlib port to javascript - fast, modularized, with browser support","version":"3.0.1","keywords":["zlib","deflate","inflate","gzip"],"contributors":[{"name":"Andrei Tuputcyn","url":"https://github.com/andr83"},{"name":"Vitaly Puzrin","url":"https://github.com/puzrin"},{"name":"Friedel Ziegelmayer","url":"https://github.com/dignifiedquire"},{"name":"Kirill Efimov","url":"https://github.com/Kirill89"},{"name":"Jean-loup Gailly"},{"name":"Mark Adler"}],"license":"(MIT AND Zlib)","repository":{"type":"git","url":"git+https://github.com/nodeca/pako.git"},"funding":[{"type":"github","url":"https://github.com/sponsors/puzrin"},{"type":"github","url":"https://github.com/sponsors/nodeca"}],"main":"./dist/pako.cjs.js","module":"./dist/pako.mjs","types":"./dist/pako.d.ts","exports":{".":{"types":"./dist/pako.d.ts","import":"./dist/pako.mjs","require":"./dist/pako.cjs.js"},"./browser":{"types":"./dist/pako.d.ts","import":"./dist/browser/pako.esm.min.mjs","require":"./dist/browser/pako.umd.min.js","default":"./dist/browser/pako.umd.min.js"},"./browser/deflate":{"types":"./dist/pako.d.ts","import":"./dist/browser/pako_deflate.esm.min.mjs","require":"./dist/browser/pako_deflate.umd.min.js","default":"./dist/browser/pako_deflate.umd.min.js"},"./browser/inflate":{"import":"./dist/browser/pako_inflate.esm.min.mjs","require":"./dist/browser/pako_inflate.umd.min.js","default":"./dist/browser/pako_inflate.umd.min.js"},"./package.json":"./package.json"},"scripts":{"lint":"eslint .","type-check":"tsc --noEmit","test":"npm run lint && npm run build && npm run type-check && node --test","coverage":"npm run lint && c8 -r text -r html node --test","build":"node support/build-dist.mjs","build_fixtures":"node support/build_fixtures.mjs","doc":"typedoc","gh-doc":"npm run doc && gh-pages -d doc -f","prepack":"npm test && npm run build && npm run doc","postpublish":"npm run gh-doc"},"devDependencies":{"@types/node":"^26.0.0","c8":"^11.0.0","eslint":"^9.39.4","gh-pages":"^6.3.0","neostandard":"^0.13.0","rollup":"^4.62.2","rollup-plugin-dts":"^6.4.1","typedoc":"^0.28.19","typescript":"^6.0.3","vite":"^8.0.14"},"gitHead":"af5fd5c387fbbb860340ee4abb4a9999518e9e8f","_id":"pako@3.0.1","bugs":{"url":"https://github.com/nodeca/pako/issues"},"homepage":"https://github.com/nodeca/pako#readme","_nodeVersion":"24.16.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-GupotUUI0mlhugKjUs4bjOwLt3nrehy9Ys2dxC0GtgVef5cnKggkDMmf2bq2poCCuVXopWPmqsc9VDT2iJUy+w==","shasum":"3156f8fa86e3cc2ae5a36369475b14d4f05696ce","tarball":"http://registry-npm.ywwl.com/pako/download/pako-3.0.1.tgz","fileCount":20,"unpackedSize":2486014,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC5clh1JiS+5HvK90fjeUmYynDLLQw9kiI17fLaKzQNuAIgff0CE/pn5CCFs+CTve/+3YO6mT9ICUHwxZ4NGu9ShBk="}],"size":599308,"noattachment":false,"key":"/pako/-/pako-3.0.1.tgz"},"_npmUser":{"name":"vitaly","email":"vitaly@rcopen.com"},"directories":{},"maintainers":[{"name":"vitaly","email":"vitaly@rcopen.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pako_3.0.1_1783340586890_0.047349980942326786"},"_hasShrinkwrap":false,"readme":"pako\n==========================================\n\n[![CI](https://github.com/nodeca/pako/workflows/CI/badge.svg)](https://github.com/nodeca/pako/actions)\n[![NPM version](https://img.shields.io/npm/v/pako.svg)](https://www.npmjs.org/package/pako)\n\n> Very fast zlib-compatible compression for JavaScript.\n\n## Why pako is cool\n\n- __Binary-equivalent output.__ Pako can produce the same deflate/gzip bytes as\n  original [zlib](http://www.zlib.net/) (1.3.2) and Node.js' patched zlib.\n- __Tiny browser bundles.__ Full minified bundle is under 15K gzipped.\n  Deflate-only and inflate-only builds are smaller.\n- __Very fast.__ Performance is comparable with native zlib in modern JavaScript\n  engines (see benchmarks).\n\n\n## Benchmarks\n\nnode v24, 1 MB input sample:\n\n```\ndeflate-pako x 14.27 ops/sec ±3.41% (37 runs sampled)\ndeflate-pako-zlib-hash x 10.60 ops/sec ±0.50% (29 runs sampled)\ndeflate-zlib x 30.30 ops/sec ±0.61% (51 runs sampled)\ngzip-pako x 13.48 ops/sec ±0.50% (36 runs sampled)\ninflate-pako x 138 ops/sec ±1.26% (75 runs sampled)\ninflate-zlib x 397 ops/sec ±1.37% (81 runs sampled)\nungzip-pako x 125 ops/sec ±1.46% (73 runs sampled)\n```\n\n\n## Install\n\n```\nnpm install pako\n```\n\n> [!NOTE]\n> For a quick look at `dist/` folder contents, see\n> <https://unpkg.com/pako@latest/>.\n\n\nExamples / API\n--------------\n\nFull docs - http://nodeca.github.io/pako/\n\n```javascript\nimport { Deflate, Inflate, deflate, inflate } from 'pako';\n\n// Deflate\n//\nconst input = new Uint8Array();\n//... fill input data here\nconst output = deflate(input);\n\n// Inflate (simple wrapper can throw exception on broken stream)\n//\nconst compressed = new Uint8Array();\n//... fill data to uncompress here\ntry {\n  const result = inflate(compressed);\n  // ... continue processing\n} catch (err) {\n  console.log(err);\n}\n\n//\n// Alternate interface for chunking & without exceptions\n//\n\nconst deflator = new Deflate();\n\ndeflator.push(chunk1, false);\ndeflator.push(chunk2); // second param is false by default.\n...\ndeflator.push(chunk_last, true); // `true` says this chunk is last\n\nif (deflator.err) {\n  console.log(deflator.msg);\n}\n\nconst output = deflator.result;\n\n\nconst inflator = new Inflate();\n\ninflator.push(chunk1);\ninflator.push(chunk2);\n...\ninflator.push(chunk_last); // no second param because end is auto-detected\n\nif (inflator.err) {\n  console.log(inflator.msg);\n}\n\nconst output = inflator.result;\n```\n\nFor CommonJS:\n\n```javascript\nconst { deflate, inflate } = require('pako');\n```\n\nIf you need the whole API as an object, use namespace import:\n\n```javascript\nimport * as pako from 'pako';\n```\n\nSometimes you may wish to work with strings — for example, to send\nstringified objects to a server. Pako's deflate detects the input data type and\nautomatically recodes strings to utf-8 prior to compression. High-level inflate\nhelpers can decode utf-8 output back to JavaScript strings with `toText: true`.\n\n```javascript\nimport { deflate, inflate } from 'pako';\n\nconst test = { my: 'super', puper: [456, 567], awesome: 'pako' };\n\nconst compressed = deflate(JSON.stringify(test));\n\nconst restored = JSON.parse(inflate(compressed, { toText: true }));\n```\n\n\n## Notes\n\nPako does not contain some specific zlib functions:\n\n- __deflate__ -  methods `deflateCopy`, `deflateBound`, `deflateParams`,\n  `deflatePending`, `deflatePrime`, `deflateTune`.\n- __inflate__ - methods `inflateCopy`, `inflateMark`,\n  `inflatePrime`, `inflateGetDictionary`, `inflateSync`, `inflateSyncPoint`, `inflateUndermine`.\n- High level inflate/deflate wrappers (classes) may not support some flush\n  modes.\n\n\n## Authors\n\n- Andrey Tupitsin [@anrd83](https://github.com/andr83)\n- Vitaly Puzrin [@puzrin](https://github.com/puzrin)\n\nPersonal thanks to:\n\n- Vyacheslav Egorov ([@mraleph](https://github.com/mraleph)) for his awesome\n  tutorials about optimising JS code for v8, [IRHydra](http://mrale.ph/irhydra/)\n  tool and his advices.\n- David Duponchel ([@dduponchel](https://github.com/dduponchel)) for help with\n  testing.\n\nOriginal implementation (in C):\n\n- [zlib](http://zlib.net/) by Jean-loup Gailly and Mark Adler.\n\n\n## License\n\n- MIT - all files, except `/src/zlib` folder\n- ZLIB - `/src/zlib` content\n","publish_time":1783340587052,"_cnpm_publish_time":1783340587052,"dist-tags":{"latest":"3.0.3"}}