{"name":"pako","version":"2.2.0","keywords":["zlib","deflate","inflate","gzip"],"license":"(MIT AND Zlib)","_id":"pako@2.2.0","maintainers":[{"name":"vitaly","email":"vitaly@rcopen.com"}],"contributors":[{"url":"https://github.com/andr83","name":"Andrei Tuputcyn"},{"url":"https://github.com/puzrin","name":"Vitaly Puzrin"},{"url":"https://github.com/dignifiedquire","name":"Friedel Ziegelmayer"},{"url":"https://github.com/Kirill89","name":"Kirill Efimov"},{"name":"Jean-loup Gailly"},{"name":"Mark Adler"}],"homepage":"https://github.com/nodeca/pako#readme","bugs":{"url":"https://github.com/nodeca/pako/issues"},"dist":{"shasum":"246b9d4c841a8d308e484c0d03786651b143e63a","tarball":"http://registry-npm.ywwl.com/pako/download/pako-2.2.0.tgz","fileCount":33,"integrity":"sha512-zJq6RP/5q+TO2OpFV3FHzlPnFjmkb7Nc99a5SNjJE+uu/PkpChs+NIZSSzbBoD+6kjiISXjfYdwj1ZRQ81dz/w==","signatures":[{"sig":"MEUCIQCCZITr1/Od6ZRINCEnilLCxJKkLWnafMpHJSE4yK930QIgAw6X/z4KTOlspneN3BkhnKetMdLchJbVlMm3lU7HPGY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1661117,"size":422678,"noattachment":false,"key":"/pako/-/pako-2.2.0.tgz"},"module":"./dist/pako.esm.mjs","exports":{".":{"import":"./dist/pako.esm.mjs","require":"./index.js"},"./lib/*":"./lib/*","./dist/*":"./dist/*","./lib/zlib/*":"./lib/zlib/*","./lib/utils/*":"./lib/utils/*","./package.json":"./package.json"},"funding":[{"url":"https://github.com/sponsors/puzrin","type":"github"},{"url":"https://github.com/sponsors/nodeca","type":"github"}],"gitHead":"c743a323fb7dd18d70e260a104ce7e22f8f106f0","scripts":{"doc":"node support/build_doc.js","lint":"eslint .","test":"npm run lint && node --test","build":"rollup -c","gh-doc":"npm run doc && gh-pages -d doc -f","coverage":"npm run lint && c8 -r text -r html node --test","build_fixtures":"node support/build_fixtures.js","prepublishOnly":"npm run gh-doc"},"_npmUser":{"name":"vitaly","email":"vitaly@rcopen.com"},"repository":{"url":"git+https://github.com/nodeca/pako.git","type":"git"},"_npmVersion":"11.13.0","description":"zlib port to javascript - fast, modularized, with browser support","directories":{},"_nodeVersion":"24.16.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"c8":"^11.0.0","ndoc":"^6.0.0","eslint":"^7.13.0","rollup":"^2.33.1","shelljs":"^0.8.4","gh-pages":"^3.1.0","multiparty":"^4.1.3","@babel/preset-env":"^7.12.1","@rollup/plugin-babel":"^5.2.1","rollup-plugin-terser":"^7.0.2","@rollup/plugin-commonjs":"^16.0.0","@rollup/plugin-node-resolve":"^10.0.0"},"_npmOperationalInternal":{"tmp":"tmp/pako_2.2.0_1782151845410_0.12137002710080647","host":"s3://npm-registry-packages-npm-production"},"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":1782151845553,"_cnpm_publish_time":1782151845553,"dist-tags":{"latest":"3.0.3"}}