{"_id":"@mischnic/pako","_rev":"1-413176a912d15c1216ea73de4185e764","name":"@mischnic/pako","dist-tags":{"latest":"1.0.10"},"versions":{"1.0.10":{"name":"@mischnic/pako","description":"zlib port to javascript - fast, modularized, with browser support","version":"1.0.10","main":"lib/index.js","module":"es/index.js","keywords":["zlib","deflate","inflate","gzip"],"homepage":"https://github.com/mischnic/pako","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":"https://github.com/mischnic/pako.git"},"scripts":{"test":"make test"},"devDependencies":{"ansi":"^0.3.1","benchmark":"^2.1.4","browserify":"^16.2.3","buffer-from":"^1.1.1","eslint":"^5.9.0","istanbul":"^0.4.5","mocha":"^5.2.0","multiparty":"^4.1.3","ndoc":"^5.0.1","uglify-js":"=3.4.8","zlibjs":"^0.3.1"},"dependencies":{},"sideEffects":false,"publishConfig":{"access":"public"},"licenseText":"(The MIT License)\n\nCopyright (C) 2014-2017 by Vitaly Puzrin and Andrei Tuputcyn\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","_id":"@mischnic/pako@1.0.10","dist":{"shasum":"887f4df17450c15eae90cb35d9d2e787b19c6aaf","integrity":"sha512-KdC+M963ugqgV7VmMlckoszTpr5AQ+gXsdDP/wVRiU6TSG/ljPJmd5o0FF5STg4NQ+a5W1o5Q4x9pm511i364A==","tarball":"https://registry.npmjs.org/@mischnic/pako/-/pako-1.0.10.tgz","fileCount":45,"unpackedSize":452668,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdmvGjCRA9TVsSAnZWagAAOOoP/ArEQEqoqRiFkE8huKgK\nPyWHqiaWV9ldjoL+PjiTlhjlafwqx2gqt84xFJz83Xa9sJ44zbaEzds0SdfP\nlOQKewot7sOD8OWHucdxNd3GKi1fYofKoJ++FHXuwI/+OQ269war//n8PVSf\nT0iaq9rbe9TsrpjJGXszPq1CW6H+lv+VEYM8AURqyjUZ+fS4CdoyVdryAu8a\nMh96uwAgGvDYEgqLhdgRStluzAcaiqrZOdtWijNYxVGAVBRarEcxsb2NmSM1\nheMCKhvX9RkHd/y07gGCS4TK6WVXmh0ezEOIFoTGwD8+jcRrR34sWRpRWR/j\nDqDsn/Dms79Qsk1tLlxhG0A2Qh+qBuhYpxAm5gm0XJscfWZcpklhnKiFfq1x\nlbH/sj3OwTh+ICcTzUe/h1K7P0xLtn1ITQeMCj3D5b8E/bPiucoaJ6KRXNrm\nh50kTxhpvX1JfvYwFuWnDEcgBr1TNQRZKUEq3TGUAUxaHhW668fApbaXK2Qr\nMWgg4LcF2T4+OvNT3k4SjKjmz3n1U/AoC7ahYNZ1W7wrKQiRrds77fObehkk\nomZSaOAj5LSbp6Waipt86asmof8Rxtt8oMi/MKPi/I9jYnpx7SWfuS6FBHd3\nydxBOHay1++/6h1slDxvWAZc6vGLZdEB/GV5avN0KTaumEFEX9Q3Jwk8qLoA\n2CyE\r\n=UwJT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEa/555OKCOfF4kJdvYxkFbJlGF+rMyuax4jH/+6MU0VAiEA3l5j6ofovhTU2I7XeuF0j5OGUsXtfO2pxJVEQOTUO7A="}]},"maintainers":[{"name":"mischnic","email":"niklas.mischkulnig@gmail.com"}],"_npmUser":{"name":"mischnic","email":"niklas.mischkulnig@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pako_1.0.10_1570435490970_0.45376206618975634"},"_hasShrinkwrap":false}},"time":{"created":"2019-10-07T08:04:50.752Z","1.0.10":"2019-10-07T08:04:51.152Z","modified":"2022-04-06T05:48:27.895Z"},"maintainers":[{"name":"mischnic","email":"niklas.mischkulnig@gmail.com"}],"description":"zlib port to javascript - fast, modularized, with browser support","homepage":"https://github.com/mischnic/pako","keywords":["zlib","deflate","inflate","gzip"],"repository":{"type":"git","url":"https://github.com/mischnic/pako.git"},"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)","readme":"pako\n==========================================\n\n[![Build Status](https://travis-ci.org/nodeca/pako.svg?branch=master)](https://travis-ci.org/nodeca/pako)\n[![NPM version](https://img.shields.io/npm/v/pako.svg)](https://www.npmjs.org/package/pako)\n\n> zlib port to javascript, very fast!\n\n__Why pako is cool:__\n\n- Almost as fast in modern JS engines as C implementation (see benchmarks).\n- Works in browsers, you can browserify any separate component.\n- Chunking support for big blobs.\n- Results are binary equal to well known [zlib](http://www.zlib.net/) (now contains ported zlib v1.2.8).\n\nThis project was done to understand how fast JS can be and is it necessary to\ndevelop native C modules for CPU-intensive tasks. Enjoy the result!\n\n\n__Famous projects, using pako:__\n\n- [browserify](http://browserify.org/) (via [browserify-zlib](https://github.com/devongovett/browserify-zlib))\n- [JSZip](http://stuk.github.io/jszip/)\n- [mincer](https://github.com/nodeca/mincer)\n- [JS-Git](https://github.com/creationix/js-git) and\n  [Tedit](https://chrome.google.com/webstore/detail/tedit-development-environ/ooekdijbnbbjdfjocaiflnjgoohnblgf)\n  by [@creationix](https://github.com/creationix)\n\n\n__Benchmarks:__\n\n```\nnode v0.10.26, 1mb sample:\n\n   deflate-dankogai x 4.73 ops/sec ±0.82% (15 runs sampled)\n   deflate-gildas x 4.58 ops/sec ±2.33% (15 runs sampled)\n   deflate-imaya x 3.22 ops/sec ±3.95% (12 runs sampled)\n ! deflate-pako x 6.99 ops/sec ±0.51% (21 runs sampled)\n   deflate-pako-string x 5.89 ops/sec ±0.77% (18 runs sampled)\n   deflate-pako-untyped x 4.39 ops/sec ±1.58% (14 runs sampled)\n * deflate-zlib x 14.71 ops/sec ±4.23% (59 runs sampled)\n   inflate-dankogai x 32.16 ops/sec ±0.13% (56 runs sampled)\n   inflate-imaya x 30.35 ops/sec ±0.92% (53 runs sampled)\n ! inflate-pako x 69.89 ops/sec ±1.46% (71 runs sampled)\n   inflate-pako-string x 19.22 ops/sec ±1.86% (49 runs sampled)\n   inflate-pako-untyped x 17.19 ops/sec ±0.85% (32 runs sampled)\n * inflate-zlib x 70.03 ops/sec ±1.64% (81 runs sampled)\n\nnode v0.11.12, 1mb sample:\n\n   deflate-dankogai x 5.60 ops/sec ±0.49% (17 runs sampled)\n   deflate-gildas x 5.06 ops/sec ±6.00% (16 runs sampled)\n   deflate-imaya x 3.52 ops/sec ±3.71% (13 runs sampled)\n ! deflate-pako x 11.52 ops/sec ±0.22% (32 runs sampled)\n   deflate-pako-string x 9.53 ops/sec ±1.12% (27 runs sampled)\n   deflate-pako-untyped x 5.44 ops/sec ±0.72% (17 runs sampled)\n * deflate-zlib x 14.05 ops/sec ±3.34% (63 runs sampled)\n   inflate-dankogai x 42.19 ops/sec ±0.09% (56 runs sampled)\n   inflate-imaya x 79.68 ops/sec ±1.07% (68 runs sampled)\n ! inflate-pako x 97.52 ops/sec ±0.83% (80 runs sampled)\n   inflate-pako-string x 45.19 ops/sec ±1.69% (57 runs sampled)\n   inflate-pako-untyped x 24.35 ops/sec ±2.59% (40 runs sampled)\n * inflate-zlib x 60.32 ops/sec ±1.36% (69 runs sampled)\n```\n\nzlib's test is partially affected by marshalling (that make sense for inflate only).\nYou can change deflate level to 0 in benchmark source, to investigate details.\nFor deflate level 6 results can be considered as correct.\n\n__Install:__\n\nnode.js:\n\n```\nnpm install pako\n```\n\nbrowser:\n\n```\nbower install pako\n```\n\n\nExample & API\n-------------\n\nFull docs - http://nodeca.github.io/pako/\n\n```javascript\nvar pako = require('pako');\n\n// Deflate\n//\nvar input = new Uint8Array();\n//... fill input data here\nvar output = pako.deflate(input);\n\n// Inflate (simple wrapper can throw exception on broken stream)\n//\nvar compressed = new Uint8Array();\n//... fill data to uncompress here\ntry {\n  var result = pako.inflate(compressed);\n} catch (err) {\n  console.log(err);\n}\n\n//\n// Alternate interface for chunking & without exceptions\n//\n\nvar inflator = new pako.Inflate();\n\ninflator.push(chunk1, false);\ninflator.push(chunk2, false);\n...\ninflator.push(chunkN, true); // true -> last chunk\n\nif (inflator.err) {\n  console.log(inflator.msg);\n}\n\nvar output = inflator.result;\n\n```\n\nSometime you can wish to work with strings. For example, to send\nbig objects as json to server. Pako detects input data type. You can\nforce output to be string with option `{ to: 'string' }`.\n\n```javascript\nvar pako = require('pako');\n\nvar test = { my: 'super', puper: [456, 567], awesome: 'pako' };\n\nvar binaryString = pako.deflate(JSON.stringify(test), { to: 'string' });\n\n//\n// Here you can do base64 encode, make xhr requests and so on.\n//\n\nvar restored = JSON.parse(pako.inflate(binaryString, { to: 'string' }));\n```\n\n\nNotes\n-----\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. Those should work: Z_NO_FLUSH, Z_FINISH, Z_SYNC_FLUSH.\n\n\nSupport pako\n------------\n\nYou can support this project via [Tidelift subscription](https://tidelift.com/subscription/pkg/npm-pako?utm_source=npm-pako&utm_medium=referral&utm_campaign=readme).\n\n\nAuthors\n-------\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\nLicense\n-------\n\n- MIT - all files, except `/lib/zlib` folder\n- ZLIB - `/lib/zlib` content\n","readmeFilename":"README.md"}