{"_id":"uzip-module","_rev":"4-e2af394faadde0d54f068846297f93de","name":"uzip-module","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"uzip-module","version":"1.0.0","description":"Module version of UZIP.js","main":"UZIP.js","module":"UZIP.js","scripts":{"test":"node test/puppeteer.notjs"},"keywords":["zip","unzip","inflate","deflate","zlib"],"author":"","license":"MIT","devDependencies":{"chai":"^4.2.0","express":"^4.17.1","mocha":"^6.2.0","puppeteer":"^1.20.0"},"gitHead":"10fa7d4b9e53e8217a74d9ae0c7600895e6a077b","_id":"uzip-module@1.0.0","_nodeVersion":"12.5.0","_npmVersion":"6.10.0","dist":{"integrity":"sha512-MyGpdd7PoZyeeHWAPn4AoI56jFQ6KXZ34JgUmDS3XdrLO0Y+aT6lo8r7Wo724JIEBM0zqgpMACRCbJU9404f7A==","shasum":"00ec95a55788d27374d7a19259999e8152c257f0","tarball":"https://registry.npmjs.org/uzip-module/-/uzip-module-1.0.0.tgz","fileCount":7,"unpackedSize":33871,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdhkYFCRA9TVsSAnZWagAA9EkP/2yuyTcU8qV7plYW5gg+\n6oxXLhR3jIYNqwwgVqiNwSoBpu7YBPCI40f6nkM9POZ74PGY07wvBH12i6gr\n6+sJpCRPui4aSaZDD8ZTsnEyV+8FNl1v4+DlpRi5AsLyo5ajkjm6UDC9e4sL\nxeIa8+Gr9C8xDgsiF/As/haF2G8OJEemvqD++WKIko/LyRPf8EE+29pQY4Ay\nBRGHGdvhcVBSLps9JNHXEJ3CGvmnOM2VtM4Ml4jC3J0QSFzK7R6knVybW/Rh\nNFhxfixdE3jdp0jE2hfyfz7Tx2wsh4WWxqzrRCcLPyd0h2I/MgfR83ZlU1sm\noWHs4azHR8rfLzS0maF3o/zpSMB6cEo23QgKXyFnlSCPJcCx5DzHsQQGOLsR\nCdASgFRuezRsqenukntu+v0hPGYSiuXsY6XZiFeF2l8H9BCmk7pgrBrPj87f\nKZMu6RW9MTkDwe/y/m5iyWKE7B+3Z9XE/5E3hEeYAjn35Q3xtq99CUNjzGNd\noQUTyDRecClbVOoV4yy9cidHrNmVo2QxYb+U8rc2E++vDSV2/1zlo6hVudqc\n+mLeme1YuIKqoZSaLLdcdBlzfn9qEJHVaUR2cGDyJ3llyUDrOcrNoBKKeCzb\nsrJY8tA1MdcWA1gZO31mHzbTbSePDdnc8082ftXZa3GL9w7VKrxKjETSvEzx\nTOg4\r\n=4Tuu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDcijmju/OdztJT2uAjDCRvQpXrRH7Q0pohOOgL7USbQwIgLVN+rKMvaqZl0P3HIXtp2a16DpsLFAsBIvakD7DabcU="}]},"maintainers":[{"name":"greggman","email":"github@greggman.com"}],"_npmUser":{"name":"greggman","email":"github@greggman.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/uzip-module_1.0.0_1569080836576_0.5241222792258298"},"_hasShrinkwrap":false},"1.0.1":{"name":"uzip-module","version":"1.0.1","description":"Module version of UZIP.js","type":"module","module":"src/UZIP.js","scripts":{"test":"node test/puppeteer.notjs"},"keywords":["zip","unzip","inflate","deflate","zlib"],"author":"","license":"MIT","devDependencies":{"chai":"^4.2.0","express":"^4.17.1","mocha":"^6.2.0","puppeteer":"^1.20.0"},"gitHead":"38abace1ef3472b74035a2512f817facc69edd08","_id":"uzip-module@1.0.1","_nodeVersion":"12.5.0","_npmVersion":"6.10.0","dist":{"integrity":"sha512-6Y1pS/e9wo+1/gIeyk2dJrAnS//LJX7gjSR8taXVt/Xi7nfjGmSwFRDV7whGyA04k+Ia/d6CaQaHOibnLTAkNg==","shasum":"ee99fdb7ad319117d7efa62781a21c810f89ff07","tarball":"https://registry.npmjs.org/uzip-module/-/uzip-module-1.0.1.tgz","fileCount":7,"unpackedSize":33874,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdhkoMCRA9TVsSAnZWagAA19kP/iXNvyNOcfdsfK6X1dTi\nDbvVLgvHaZN0JSnEZ78mjkHvq6AFjVxwy//9281MexTub9zB/qQCOQ773YjY\nQh/yOn2WPhAj0HHNdac70y1T9CL5zIH0aWDjXcAdwZ65arbeqjitIxclpt4K\nrGC1LlO1JdYiV2lLybd0cr+rIkv38+/l/rZT3Eq3FYgsqw89u/RF9tplC6dK\n+clPZRF9YzFzzsrHKavWSaTvxwt0wCJjqdHmej0dOK0CIhJeBS9Sm0OixamL\njAyfwmIH7COO/OnXr3qWk1LxueW4M7vAoHs5cjt5Xuov9u0WbYWh442GfI1T\n6Y+e5w3xSMpm4IjOcv+iPBovRnSn5SaWt9lnylhD2HxJpardeB0XJPhVnJKO\nXtB5B15ZkLObw1ulhHGPWz7tn/6tRN0fmh5lsdSCem7B9VkecpZ2G0dF19Nq\nZkcSN9EdIFQtNZdQKZow9tRGSrxr1sxAFXrUCvU5eqqdQlw9Snsws5amSlGa\nOl8rCcfD0hoJ0H+UE/Cn3yZqv8caSfm5RUesgjjHijCSKDFYLmb7XzrRFMn3\nNn3q1k3MJt2XYT3302LeuQNXkRZubu+a9z361XJ8yxpNFkwk7QLLc/oWpuyC\nfeTExxUZRxeSXXC1a2anlUuCApArjIthKdDVwmRzTSWhiCh56J+xjSi185R6\niCeF\r\n=8Yl1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCM+9C28xPya0O1SEsLoT3AXtDyG6mhOm5+GK7eNlfQfQIgZi56P/aYMq7hkb5E4uMln00nF7F8Ry4GX+m0ubdqtSc="}]},"maintainers":[{"name":"greggman","email":"github@greggman.com"}],"_npmUser":{"name":"greggman","email":"github@greggman.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/uzip-module_1.0.1_1569081867779_0.8311457533681907"},"_hasShrinkwrap":false},"1.0.2":{"name":"uzip-module","version":"1.0.2","description":"Module version of UZIP.js","type":"module","module":"src/UZIP.js","scripts":{"test":"node test/puppeteer.notjs"},"keywords":["zip","unzip","inflate","deflate","zlib"],"author":"","license":"MIT","devDependencies":{"chai":"^4.2.0","express":"^4.17.1","mocha":"^6.2.0","puppeteer":"^1.20.0"},"gitHead":"31daf62d60711dc7efeba877583cbaeed2ed973b","_id":"uzip-module@1.0.2","_nodeVersion":"12.5.0","_npmVersion":"6.10.0","dist":{"integrity":"sha512-j4yJsn/5FtC6V6xOpU4235ze2j3FCVRpXqR94UolkZkCv9rRTkXfVKaTyg+CXUI0Dt0MjwZuw3hKXQS3MRni8w==","shasum":"eba08001334f6ca0a83a94baf2d4dd368ba8b344","tarball":"https://registry.npmjs.org/uzip-module/-/uzip-module-1.0.2.tgz","fileCount":8,"unpackedSize":33872,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdoDu1CRA9TVsSAnZWagAAMsMP/3fe62CyYj8A0SZIm8KA\n+pZngqyRFBHvDAgEbrqINQimRFGCP+rLpprBZi9RLHZUcuOJiiZKgnXt8azd\niSH2M6N76Sqxgiv/Xbtzr2JKK92N9RVfOP4tp5RH245xs/K8n8YpeUfDXSoE\nCnjIb7tKewWyDjk1PMThdGDTqh0IToRZxeQGBavphYDiAiwQyeAuJqXHIg2/\nd4/YG4tLsVDdN7BDNtcI1RIVRuvTMUlJRrpOVqx3RP1zojoldMYBPSuOGYcr\n8mB6Au1nNCLt9sQ8XIu01GiwjYfIPxx8tGMsNzk8U6HIFWLkeZKk44rR0KH4\ntwKzBVEWO9P0R16+UcVnlw1KJUb9XVKgSyWXnlSQGjqxymUDG7Gril/rJecQ\nKiRoW3qSz0jA7tOGPeaCQfkppuFOjbz8rgp7mUfm9Or7fee2IhCWYJX7g3Q9\n8HmJiyGQGmkJOLZ63tMSTLNzLygjeck9PKFfL6wJ13x8bHbpYLqJknJjtwa4\n/tuq21L0II9jrBrt2f2hgNI/MM7WU2a39JtZJCn6CtI3dbrHCkU6HB1G9DSX\nWJToRKvMBFWej6SthPR583Q/RifXKUSLbo39PNuKZuj6afftlcRXYiAMWbPa\nlr9UzmaPA5+mmm/bHqqhzya81ckwkzOMKqIqSa2VIsMdnY9W39U4w5oIGKnC\nfGlC\r\n=EN0O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCKUAbosl57NQ2vKcSP5sJ0eeiWwBe15DigeOrD63hq3QIhAPtEX2l0mD9Mkil/SvaxcwNLNvPb3x/3rHQzl+q+Sz7r"}]},"maintainers":[{"name":"greggman","email":"github@greggman.com"}],"_npmUser":{"name":"greggman","email":"github@greggman.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/uzip-module_1.0.2_1570782132569_0.6902768969952877"},"_hasShrinkwrap":false},"1.0.3":{"name":"uzip-module","version":"1.0.3","description":"Module version of UZIP.js","main":"dist/UZIP.js","module":"src/UZIP.js","scripts":{"build":"rollup -c","test":"node test/puppeteer.js"},"keywords":["zip","unzip","inflate","deflate","zlib"],"repository":{"type":"git","url":"git+https://github.com/greggman/uzip-module.git"},"author":"","license":"MIT","bugs":{"url":"https://github.com/greggman/uzip-module/issues"},"devDependencies":{"chai":"^4.2.0","express":"^4.17.1","mocha":"^8.2.1","puppeteer":"^5.5.0","rollup":"^2.27.1"},"gitHead":"e4b3ea2a1265baf4e8db03ad1909394ed4aab61a","homepage":"https://github.com/greggman/uzip-module#readme","_id":"uzip-module@1.0.3","_nodeVersion":"12.18.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-AMqwWZaknLM77G+VPYNZLEruMGWGzyigPK3/Whg99B3S6vGHuqsyl5ZrOv1UUF3paGK1U6PM0cnayioaryg/fA==","shasum":"6bbabe2a3efea5d5a4a47479f523a571de3427ce","tarball":"https://registry.npmjs.org/uzip-module/-/uzip-module-1.0.3.tgz","fileCount":10,"unpackedSize":65110,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf4y0sCRA9TVsSAnZWagAA+ygQAJ2cq5AuBRtRiwd+EHPP\nk5s0w6HeT4BvkPc3yzV2SOGcvqmpQkmLXpx9Bzmzy7n5TXLZmRWY/3LCfHi+\n9hT6hCY4QAYf4u1xuoTnoO9APfFc5hd/ogGxGvAgtGVvOVXowhc6ZbdBpOag\nbTUxI0TisYGsQa6NXlkrJ9wgkFFqKSuWBPhXhXsViS9ZNMDNTEU9m+SsDyh4\ngj+irdM4kC8rzS0C+pbO3f75VVZM5DHYuCXqvWcncjonpZa08hGmzX3gR1u/\nK3PSjj2WAlMCV6d8vbKona4vOxirtla16cxDwUCf20MgEjcnPvPTag9Uw4uH\nW6LZ4HNxv+yRC++5S+oO+gc0wWfRQrQq9jeTqstSgIkLWn3dZxCgiN/fT5Ss\nWIwWHzLzHwYjpySyfaOO04jppRM3bveZjAMsLbS1T2igerLRNnAu8WsIF/6Z\nRNT9lgAk2pXYyBx24b8ZJcm0o/c54+Cny2mMQpxcnPQfXW3BJjK/mj4X77y6\n5liOYcw5Ewpx1GMkOOjgRq0Jx5y0YXVTePAYQRgsLQjR8NrUfXNovXeTI5YQ\nG4f/wJlsEGRIrePmQKJEm13tBD7GslUwZ5U0/Kc3SKXqt/cOv23n2vZBhhqu\nIxfT+K+wDDHQ9Wd+6qjhW+s7cxqlGrFpdKGCFIyCb2hVdYL0KHka1NlQl0dB\nYLQ+\r\n=JXRt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCsM9EnHjDPsaX08FVuq+LGnC/QQ6uKeA50nvvUhQLXtQIgDmInIzGJq5f8HT+L5n0qGfbqhDQ8F8VubXg97OyuKCE="}]},"_npmUser":{"name":"greggman","email":"github@greggman.com"},"directories":{},"maintainers":[{"name":"greggman","email":"github@greggman.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/uzip-module_1.0.3_1608723756403_0.4460213858511315"},"_hasShrinkwrap":false}},"time":{"created":"2019-09-21T15:47:16.576Z","1.0.0":"2019-09-21T15:47:16.700Z","modified":"2022-05-23T01:05:50.765Z","1.0.1":"2019-09-21T16:04:27.925Z","1.0.2":"2019-10-11T08:22:12.792Z","1.0.3":"2020-12-23T11:42:36.600Z"},"maintainers":[{"name":"greggman","email":"github@greggman.com"}],"description":"Module version of UZIP.js","keywords":["zip","unzip","inflate","deflate","zlib"],"license":"MIT","readme":"\n# uzip-module\n\nzlib inflate, deflate, inflateRaw, deflateRaw, as well\nas simple in memory zip creation and parsing.\n\nThis is a ES6 module version of [UZIP.js](https://github.com/photopea/UZIP.js)\n\nIt's faster than [pako](https://github.com/nodeca/pako) in my tests.\n\n# Usage\n\n```\nimport {\n  deflate,\n  deflateRaw,\n  inflate,\n  inflateRaw,\n  encode,\n  parse,\n} from 'uzip-module';\n```\n\n## deflate/inflate\n\n### compress Uint8Array using deflate algorithm. \n\nIncludes header and footer\n\n```\nconst compressed = deflate(uint8Array);\n```\n\nor\n\n```\nconst compressed = deflate(uint8Array, {level:9});\n```\n\n### decompress Uint8Array that has header and footer with delate algorithm\n\n```\nconst uncompressedUint8Array = inflate(compressedUint8Array);\n```\n\nor\n\n```\nconst uncompressedUint8Array = inflate(\n    compressedUint8Array,\n    destinationUint8Array);\n```\n\n## deflateRaw, inflateRaw\n\nThese take the exact same arguments as `inflate` and `deflate`\nbut don't store or expect the header or the footer\n\n## encode/parse\n\n### encode\n\nCreates a zip file. You pass a JavaScript object of filenames\nto Uint8Arrays it returns a Uint8Array zip file\n\n```\nconst utf8Encoder = new TextEncoder();\nconst files = {\n  'stuff/': utf8Encoder.encode(''),\n  'stuff/dog.txt': utf8Encoder.encode('german shepard\\n'),\n  'stuff/birds/': utf8Encoder.encode(''),\n  'stuff/birds/bird.txt': utf8Encoder.encode('parrot\\n'),\n  'stuff/cat.txt': utf8Encoder.encode('siamese\\n'),\n  'stuff/long.txt': utf8Encoder.encode(`${new Array(200).fill('compress').join('')}\\n`),\n}\nconst zipUint8Array = encode(files);\n```\n\n### parse\n\nDoes the opposite of encode. Takes a zip Uint8Array\nand returns a JavaScript object of filenames to Uint8Arrays\n\nCalling `parse` on the `zipUint8Array` from the previous\nexample will return the same data seen in `files` above\n\n```\nconst unzippedFiles = parse(files);\n```\n\nYou can also call it with an extra `true` in which case it will\njust return the filenames and a `size` and `csize` for each one.\nThe uncompressed and compressed sizes;\n\n```\nconst unzippedFileSizes = parse(files, true);\n```\n\n`unzippedFileSizes` would have a structure like\n\n```\n{\n  \"stuff/\": {\n    \"size\": 0,\n    \"csize\": 0\n  },\n  \"stuff/dog.txt\": {\n    \"size\": 15,\n    \"csize\": 15\n  },\n  \"stuff/long.txt\": {\n    \"size\": 1601,\n    \"csize\": 24\n  }\n}\n```\n\n# Notes\n\nAll credit goes to the original author [Photopea](https://github.com/photopea/UZIP.js).\n\nI ported this to ES6 modules to use in [another library](https://github.com/greggman/unzipit).\nOriginally I thought about putting the various parts in more separate files\nlike the inflate in one file, deflate in another, parse, and encode in others\nbut tree shaking is supposed to handle this stuff more or less\nso I think just moving it to ES6 modules is enough to get any\nunused code stripped. The only other think maybe left to do\nis change the `bin` and `f` imports in `UZIP.js` to import each\nindividual identifier instead of all of them.\n\nAlso I spent about an hour trying to get ES6 modules to work with mocha in node\nbut failed so got sick of wasting time and used puppeteer. Patches welcome\nto remove that dependency.\n\nI didn't make a non-ES6 version. If it's important submit a PR (babel) and I'll\ntake a look. \n","readmeFilename":"README.md","homepage":"https://github.com/greggman/uzip-module#readme","repository":{"type":"git","url":"git+https://github.com/greggman/uzip-module.git"},"bugs":{"url":"https://github.com/greggman/uzip-module/issues"}}