{"_id":"react-zlib-js","_rev":"12-7f2babdf4588b9b907f4715c7d737507","name":"react-zlib-js","dist-tags":{"latest":"3.0.0"},"versions":{"1.0.0":{"name":"react-zlib-js","version":"1.0.0","keywords":["Nodejs","Core","Zlib","Gzip","compression"],"author":{"name":"Anuragh K.P"},"license":"MIT","_id":"react-zlib-js@1.0.0","maintainers":[{"name":"kpanuragh","email":"kpanuragh@gmail.com"}],"homepage":"https://github.com/anuraghkp1/zlib#readme","bugs":{"url":"https://github.com/anuraghkp1/zlib/issues"},"dist":{"shasum":"bbd6d013e1ddebf089a2f4c7e2287d4dbd267f1c","tarball":"https://registry.npmjs.org/react-zlib-js/-/react-zlib-js-1.0.0.tgz","fileCount":5,"integrity":"sha512-YvajQqSV76w/2dSWlMQTPuSc1wl9c34TUe1pYZNjthlCcjXkN43ZnJ05lsvKv1j7Q80QaBT3u1BI2f0qV3RpjA==","signatures":[{"sig":"MEUCIQCfaz8o68tVAg6BKcqGXYyYqiJ0NWyT0aZgPVOOoqhK7QIgJO9cn9B6QRlnyjhcUU3YX66u5RB8OFEdhWJrZf+2A7s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":418121,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa1eCyCRA9TVsSAnZWagAAK2YP/RajGKWJ+SHdKFwx0fE8\ncTYUWA3CITq2m0HbWn9MGBKN03M70YCNHYSagdDU98o8vmY0pGe/m8P5F9rT\n4meGPiHYqGhguvfurS9UYXJsfGgBbJUtTK86JnT2SKgBCW4iSbw6BQkss88Y\nQ1C2LOAURrtzYaLcQWhxD4FB9njarZZ7dYaEBlc9n1K8yciK4eRDlV5Qf1nl\nvTZwJ7ihVWwfn9ZPzLRxey5WOepQWWDXG5+QnWQ7SEzQCMlGbqehqOa7YJ1k\nUwDD52A/bw1vk8ZU0qxEDDKHcW4VyiMFTAYspnhAOZ3xkbwqQBrpgUzVNaa7\nEBs0CEU5sXTWBea1IG3Ikx63rXfiiTRhRzl1uwBdKxHuwSAVOSOyllwmrNFi\njsRPCRbg+bmvnzvlqCd+CiB+qRcYQZw0dfkIPLV4DYJ2F0bbxGMEtFy0pTM0\nY3dAAglYe0e8cA0+wbbvr/CW/nsgb4jE7/3FeH4yTsQupdSHYWVxacJPJ+SX\nny0NnaOo1NLx1er5Lhxad89qX4CEFCOOAejKCZysww6uN7/G33O8a5ZC1FIl\nT71P83uC1U3bIbRPhUaEDABnXUVWFjZMdl/9fyQCIq/zK2L2DmJzNykDdBb/\nfSiITn2bQ6VYQFNGvoMamO6QwuIXYbJVMZUL7cGsiaesYpNORk9RJZ/YFlSy\nWr3E\r\n=e8YO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"f05bcfc2104f425f39432e2b8e880bb0c74beffc","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"kpanuragh","email":"kpanuragh@gmail.com"},"repository":{"url":"git+https://github.com/anuraghkp1/zlib.git","type":"git"},"_npmVersion":"5.8.0","description":"Pure javascript implementation of Zlib nodejs core module.The zlib module provides compression functionality implemented using Gzip and Deflate/Inflate.","directories":{},"_nodeVersion":"9.5.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/react-zlib-js_1.0.0_1523966130487_0.057453094590074194","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"react-zlib-js","version":"1.0.1","keywords":["Nodejs","Core","Zlib","Gzip","compression"],"author":{"name":"Anuragh K.P"},"license":"MIT","_id":"react-zlib-js@1.0.1","maintainers":[{"name":"kpanuragh","email":"kpanuragh@gmail.com"}],"homepage":"https://github.com/anuraghkp1/zlib#readme","bugs":{"url":"https://github.com/anuraghkp1/zlib/issues"},"dist":{"shasum":"ee07293b517282fb9e6158a2c34303a73c625f90","tarball":"https://registry.npmjs.org/react-zlib-js/-/react-zlib-js-1.0.1.tgz","fileCount":7,"integrity":"sha512-wmW1YP1q4ljdeo7fMf2+b6q+eNMQOqtfvCmQgdoZZm++QMwOpkNt7/nlBCgz+5s41+InR7V0IXTeGyTMEP19Jg==","signatures":[{"sig":"MEQCIHR6wf2iJY+0+2ydQ26lksTk8FTpoQRE7qJ+eiKoiHDxAiA3AMj4rvqwnCZYLD+z5hZRbcXPBfd+U9KkcJJbgNgDTw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":475138,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa1eu1CRA9TVsSAnZWagAA3j8QAIiA8571YycxWIgg7T/T\nsd0pJRm5litnEOH6rIB7+8xYPBo51TAsgxmQZ22q2lb4HThbDY5qAxP4PYY2\nvaxPbrl/7EBK1X35ScHUbpo9uuJIMjKrIhHuT5rC3PiBqjozRTIkmmi5uGrP\nb0xjEfeIb8qX90N8KwfEi2H6ypx1bT76nHptnPnxAopWxBoH6OnD7ba1Ngny\nselOQSCEa3UzTyh1UfgaSQE53h+cSjWVoYyhbu4j46UsrhpjA3w3RGh3K7/X\ndQf0ERaGL4PQ0leLhCGSDsas4RfCCPx8Ij9kW65Trqf3AY6zt/qisIVZ4MN6\nktCh7nc69TIztK6GlXcClQAGBW78jDyweXPMoA/Ehlt4XizuboEtHQg7IZuu\n+xLMPe4ND4gsoBRUGpHO+VrzSChkOq/jdmwDMGHK958vXCW6SzL83ulveJnQ\nWPodyYEMZynvNa8mKgVId426K9TJo6SG7wwxKm6lEP9WiQfLHDPK2Y5M3op6\nZ37ufcUmZAATi2TK4h2V/qWE3BqzwpYgzc0iGRMzX2Lcl7rUQ+8Au6V9Trj3\nHt4O7EIekdIDYFF3w1XsiyjmN4OMh9oFdeoW7+xDxzpTCPNohr1H46ln3WCY\ntGG4xfy5EeXtXApYdF50P2Oq2EUZaNXgLydeykQCWXxc3C2A0OTmhNhzWuq2\nrZnM\r\n=OLMk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"c0419c11090d3162b31f8cc05cc24e62c3682e35","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"kpanuragh","email":"kpanuragh@gmail.com"},"repository":{"url":"git+https://github.com/anuraghkp1/zlib.git","type":"git"},"_npmVersion":"5.8.0","description":"Pure javascript implementation of Zlib nodejs core module.The zlib module provides compression functionality implemented using Gzip and Deflate/Inflate.","directories":{},"_nodeVersion":"9.5.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/react-zlib-js_1.0.1_1523968949394_0.048889882556070186","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"react-zlib-js","version":"1.0.2","keywords":["Nodejs","Core","Zlib","Gzip","compression"],"author":{"name":"Anuragh K.P"},"license":"MIT","_id":"react-zlib-js@1.0.2","maintainers":[{"name":"kpanuragh","email":"kpanuragh@gmail.com"}],"homepage":"https://github.com/anuraghkp1/zlib#readme","bugs":{"url":"https://github.com/anuraghkp1/zlib/issues"},"dist":{"shasum":"4f19a122c0c4373b20baea7bd1f55d23305a0f9c","tarball":"https://registry.npmjs.org/react-zlib-js/-/react-zlib-js-1.0.2.tgz","fileCount":7,"integrity":"sha512-w8GgOV/zKFkUJZQBh5lR4po34mScQj3JMpNsXrYEUM0dz1BBBn9d34Mp92HmDp1YUGOCiGRPuJdO78VdgfdS3A==","signatures":[{"sig":"MEQCIFrMOsC3RT6tgJOrOUliAk5YZMfI2qxWzAVzBxlgPWroAiAA1Cf5NfQKt7p1SDgqfl0FIFH2B0TM07cKfV21cgdWIA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":475850,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa1e5ICRA9TVsSAnZWagAA1egP/3MlsHdFlq48kVPv8BPh\nle00C8wL9O0f29k6/rD+Nrm43pAp6cJiyxnEglLLk+gAxdXMyVzSBsv4WsrX\nfjd9a0VdD6NXDpMak2SSqYDlKOUfO9w0AmDXuPnfaNDAcxe2SDB5G62UcfE+\neJSg9JyTecAjPoMU9eE/pHAg9/Nz2S2NEntjeKwHtDzyNpkB0vDbEOdoNN7d\ntibS3VcILfD44pxoOFxTBFf3G1R8prnRkr3FH37vxL3udORRwvnWEJf/sVCK\nqEKt3PQizjTJAeinFloQSS9w/vUB10dMZZa8xe7VaTTDMkp+dbT1KmH4wMU4\nOU1hcuZVy7LaOfpPs+5Y+PFbR1LVvy2GV1ofvxdoOc+4cwhs9ClGR722YNG/\nRP2EdQTvADU02O7iY3W4eL+SEhtk/O+TCqhwrRk9lf984P2h63yERc5uM3TO\no2fK/U0WYTLIx9u3Jh5ywWuspov0LdPChm4/zidr/+Yz2sPblcxOAApb07qd\nfs5hrmTJ6RGz22brIacqKWRzHidUsmrOU045BIBNsGpUT2roZk+vSM72QTsO\nW+EZEmVQ7SiGnjytZ/sy19m1hoprTrQ3DVUZX/p1ct0bZCPkF5NSvPlMhnjB\n/6tJmZ6Wrm5DrcSuN0PeXUcvCeLr0FbRhMmrGgN2vsqw97OrxmxJ/5xpDK7G\nrLGv\r\n=4yoM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"448645748e20e23d03c10169096ce5ee6f89784c","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"kpanuragh","email":"kpanuragh@gmail.com"},"repository":{"url":"git+https://github.com/anuraghkp1/zlib.git","type":"git"},"_npmVersion":"5.8.0","description":"Pure javascript implementation of Zlib nodejs core module.The zlib module provides compression functionality implemented using Gzip and Deflate/Inflate.","directories":{},"_nodeVersion":"9.5.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/react-zlib-js_1.0.2_1523969608502_0.2715272407300853","host":"s3://npm-registry-packages"}},"1.0.3":{"name":"react-zlib-js","version":"1.0.3","keywords":["Nodejs","Core","Zlib","Gzip","compression"],"author":{"name":"Anuragh K.P"},"license":"MIT","_id":"react-zlib-js@1.0.3","maintainers":[{"name":"kpanuragh","email":"kpanuragh@gmail.com"}],"homepage":"https://github.com/anuraghkp1/zlib#readme","bugs":{"url":"https://github.com/anuraghkp1/zlib/issues"},"dist":{"shasum":"d15a66214f4734ec7621f3fb8b0bfb26337476c8","tarball":"https://registry.npmjs.org/react-zlib-js/-/react-zlib-js-1.0.3.tgz","fileCount":7,"integrity":"sha512-3bY1VobBbKvLTTT7rJ5WzjnHmfPqSMjs5Twxrx3mG93bLBY+fG6dxtP5YzrvgPQCWAB7aSgQkZEEDPWOE6U7Pg==","signatures":[{"sig":"MEYCIQDkvIBRcDNo8ytVeJOt6BXOwnntyLvsoRvx00KzgBudngIhAIR3EZg5eIU3jqSKbh3O2Cnp9KuJh5gNVBqh5YOhlSa9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":475850,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa1tPRCRA9TVsSAnZWagAA1lUP/0AmuEXSfRrL2hGQ9Dt7\nT4QA3Qp5Kp/PcRPXLFP6PoG1rrPSEVD2wKhVh2kSRyjaC0prfCKsGlwiP1TZ\noyGyJPfB/JpKHpGV4OcWUwiDTG1t3hucg7y27r31Gl5L8hh4e4TrU+KAy4Uy\n2fNgAtgcEjrFRtGSv27qU+qj15tVMY29EGmXVaJPE5XLxkQoCfM8k1DvC5yw\nlSGaG7KYungW6GO1caqY1rlJ3YrpUysf0exJ6SkVh+3ZdpSf35YZeKebxSmB\n2coQzkZ1fN6kqbpodzexwSc0X46JngEtXiYgT4JjVHfT0yV5bB5Z5BI4MgQm\n5SRzV+MLYp++6lNLOYsfXNQ7jg9ABpDsBbdjs2457Pf6yAPK/ZGlm2Ni44Mo\n726HqiqK3+KPofMp4TZSlmRfvS5k6m9Fl/nC5EVqkcxtCHDKfQe7gWNYzGqD\nCkxcRBK3vXjZzWEYoOLUtNqZ/8s0n85R2Qd5sicppbDKBtvDXM6ZOH/cwiz3\nGYuKjfalwKhkEV/TLcT8N8kBYieRQVm9uQs32DYPg6vwQk5VrxMaw9eVKVrX\np98bkOMvKMj8/1/HruFmirJRaRRVG+8L+YPOyTzvzUWARdUhpAQRlRqdFS9Z\nFViIqmUcOm9R4UQetI9FxYpjNGjIqodCHF22a+v5M4nCyU7wEG8iijTnIqzH\nH6X6\r\n=E7cY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"bbca50e552248081a6ed21daa116376740e8d1f1","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"kpanuragh","email":"kpanuragh@gmail.com"},"repository":{"url":"git+https://github.com/anuraghkp1/zlib.git","type":"git"},"_npmVersion":"5.8.0","description":"Pure javascript implementation of Zlib nodejs core module.The zlib module provides compression functionality implemented using Gzip and Deflate/Inflate.","directories":{},"_nodeVersion":"9.5.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/react-zlib-js_1.0.3_1524028369041_0.41765318322455025","host":"s3://npm-registry-packages"}},"1.0.4":{"name":"react-zlib-js","version":"1.0.4","keywords":["Nodejs","Core","Zlib","Gzip","compression"],"author":{"name":"Anuragh K.P"},"license":"MIT","_id":"react-zlib-js@1.0.4","maintainers":[{"name":"kpanuragh","email":"kpanuragh@gmail.com"}],"homepage":"https://github.com/anuraghkp1/zlib#readme","bugs":{"url":"https://github.com/anuraghkp1/zlib/issues"},"dist":{"shasum":"dd2b9fbf56d5ab224fa7a99affbbedeba9aa3dc7","tarball":"https://registry.npmjs.org/react-zlib-js/-/react-zlib-js-1.0.4.tgz","fileCount":6,"integrity":"sha512-ynXD9DFxpE7vtGoa3ZwBtPmZrkZYw2plzHGbanUjBOSN4RtuXdektSfABykHtTiWEHMh7WdYj45LHtp228ZF1A==","signatures":[{"sig":"MEYCIQCEGqaUi3o1oKTFbRceXNysw7V3RrDS9Jhc9vZ5b9wnRAIhANHUEVJl3arz+vAHN4bDTmUhiEhZtYQg9FIAE4RqMKet","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":476486,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa2dBwCRA9TVsSAnZWagAAzWYP/i7Esj57PPBXwPNLvyWV\nhhlVmjVVYgusjUjGQ4TPnCf9Q/nNzwgf92XZhj28ARiGtOuk/S/6iYgSfUkl\nFXsIyT6iwwdVC7zbXRGtp8Ey82RMmWnCvUG79sS+ShBG5e/F1F4gTHc2TAjt\nr73aul+mRNHZpZqvxC0+gNgcXaZ/uwecbY9rFcpedPJaMVNwC0gZkPg4oOEE\n65xhQKHQOcPHwHP59lprDq+J1EZra7zE+/2ov8ASTHjXuFbpVsdU7b0CFpFh\ntd5lQtCWTbBeFcA+IQib12ArxLbVmgYNd4r5xbi/f6gv2Dlp+2+C9Mbvm9Da\nBGlV1enwJ0ucymSHzZwEBvphOJKofXqYh7ZWbda2+FAibChbjNbYXjST8noS\n9dqJW6Of8xIJJXt0cXDMMt4tT7RAbJwD/012TuaoTgPWgJHmC2V0r0Ds7915\nPKYlVAIYCsjmP1k0xm1gNr/emLaJI2ocBMq8sYaS6+TAYO7MImWPsBGbRZuh\nJdKwiSvGLNKaA+EIdELtBRBjcQqCEZUpINWhTIwt2JzTuE2KQilDphW/w1Dh\n5egAT2uDN0MaQIdboK/NeGnbOXw6/26n/QmqgnwYxQABReWqxhKJCcCkNRs0\nw0oCMPefdG0vL8ioRagNq6fc5k0SkyMDdLg9cwCMgI84SJmECiskWZSr5XRo\nurUC\r\n=TyQU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"3dd6c6125816cba917acca58889977917401b09f","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"kpanuragh","email":"kpanuragh@gmail.com"},"repository":{"url":"git+https://github.com/anuraghkp1/zlib.git","type":"git"},"_npmVersion":"5.8.0","description":"Pure javascript implementation of Zlib nodejs core module.The zlib module provides compression functionality implemented using Gzip and Deflate/Inflate.","directories":{},"_nodeVersion":"9.5.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/react-zlib-js_1.0.4_1524224112103_0.8791409516683604","host":"s3://npm-registry-packages"}},"1.0.5":{"name":"react-zlib-js","version":"1.0.5","keywords":["Nodejs","Core","Zlib","Gzip","compression"],"author":{"name":"Anuragh K.P"},"license":"MIT","_id":"react-zlib-js@1.0.5","maintainers":[{"name":"kpanuragh","email":"kpanuragh@gmail.com"}],"homepage":"https://github.com/anuraghkp1/zlib#readme","bugs":{"url":"https://github.com/anuraghkp1/zlib/issues"},"dist":{"shasum":"7bb433e1a4ae53a8e6f361b3d36166baf5bbc60f","tarball":"https://registry.npmjs.org/react-zlib-js/-/react-zlib-js-1.0.5.tgz","fileCount":6,"integrity":"sha512-TLcPdmqhIl+ylwOwlfm1WUuI7NVvhAv3L74d1AabhjyaAbmLOROTA/Q4EQ/UMCFCOjIkVim9fT3UZOQSFk/mlA==","signatures":[{"sig":"MEUCIBD7eggCAMAlwoOJq96LGz1X+miGL1MaYjINhyD7A3lLAiEAmmVsqCs4n486x3UJRMDOkA73PG97ZCFsT4F8lPrqJU8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":486994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfO8DaCRA9TVsSAnZWagAA76QP/31oL2Vd/WDIrpmNSQ7V\nDQPb9E+T0Dh1fsog7kCVS61iyM6FW19quuYoCz3PL2i7kafOzlngNphiNIk4\nMrbS6mnFk1oGr9GRUtg043O6QSQqoqbx1eVstqHS3GdxIAcQkrBLYmYF0wa9\nLktAnSjPqIfvNVhMusy8RSO67wW8b8zcJM3wewJ3Lora9DzIIla37jwDYiSW\nrlTCn69eoW4RZjjiJctr1TSfEj3F8JwnpmmJ9+utGQbU5NwQBzNjMqZvlGxk\nDRRpeB15vp4Cn2RgweW2fTS28Vv+Yax1MUPpsaZDICJnysHnQrm3/1gHfU3l\nopdOO6TalU1KMiHwGV/AZoSwGu8Rqu0qxMF43WIC+3EOo5lCMSjTU/8BZq7G\nUKU6xWeaFYIahcaUI3UKxT1+BnRNuv2mJJgi4n90nUQpCu67b7lalQVeWsCd\nGBGs6jYKLH7lRHtYj5L/XLmApN49z73MwS/wJfJ2ljYgOS+/S07JapS21QEU\nQh5EH/n9MnP9NIgb0uLqDexV7DrFhfo0XR+RoMAap80a1XKrKMhDqnVAxAqG\ngmyAta8/bKgvk2ddglIP5tv70y7o4lBjsFGlKTKHJ6mkuVuoFp4L+FZcrmNu\nCkIUeFCm5BviCSBnAQnFqOKpst7KmTzwvMEnmS1J4x7UVwzuw0Nzb0KirGc2\n2pm2\r\n=y7Ph\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"2d7b94e02538d3bc1ad3e187795be88c78aca601","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"kpanuragh","email":"kpanuragh@gmail.com"},"repository":{"url":"git+https://github.com/anuraghkp1/zlib.git","type":"git"},"_npmVersion":"6.14.7","description":"Pure javascript implementation of Zlib nodejs core module.The zlib module provides compression functionality implemented using Gzip and Deflate/Inflate.","directories":{},"_nodeVersion":"12.18.3","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/react-zlib-js_1.0.5_1597751513632_0.40529011156399997","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"react-zlib-js","version":"2.0.0","keywords":["Nodejs","Core","Zlib","Gzip","Brotli","compression","deflate","inflate","react-native"],"author":{"name":"Anuragh K.P"},"license":"MIT","_id":"react-zlib-js@2.0.0","maintainers":[{"name":"kpanuragh","email":"kpanuragh@gmail.com"},{"name":"nanduldas","email":"nanduldas@gmail.com"}],"homepage":"https://github.com/anuraghkp1/zlib#readme","bugs":{"url":"https://github.com/anuraghkp1/zlib/issues"},"dist":{"shasum":"09eb4bcf8791853c3dd09fe85e7b1633d90ce58e","tarball":"https://registry.npmjs.org/react-zlib-js/-/react-zlib-js-2.0.0.tgz","fileCount":12,"integrity":"sha512-z6m0ahlyPSfYxZzu6fJkeQU6OeW99kJlm3KuxmEy0C/W0DvnD8KLUrk3vbEXd+7s4CCEXSF9lW5uND55ikxITA==","signatures":[{"sig":"MEUCIBoRLw/1davkFklHQPZiRdXd9mx0VXZRsuwlbFY5NNR+AiEAzSwnW1+k20WHTD9ubuJ8dCiyxOTu6YQWP5gqonEd198=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1481224},"main":"index.js","gitHead":"e7f3f6720660f30b28fe09dc0a4ca6e784b8e7c8","scripts":{"test":"node test.js","build":"browserify src/entry.js -s zlib -o index.js","build:buffer":"browserify node_modules/buffer/index.js -s buffer -o buffer.js"},"_npmUser":{"name":"kpanuragh","email":"kpanuragh@gmail.com"},"repository":{"url":"git+https://github.com/anuraghkp1/zlib.git","type":"git"},"_npmVersion":"11.6.1","description":"Pure javascript implementation of Zlib nodejs core module. The zlib module provides compression functionality implemented using Gzip, Deflate/Inflate, and Brotli. Compatible with Node.js 22.x LTS.","directories":{},"_nodeVersion":"24.11.0","dependencies":{"pako":"^1.0.11","brotli":"^1.3.3"},"_hasShrinkwrap":false,"devDependencies":{"browserify":"^17.0.0"},"_npmOperationalInternal":{"tmp":"tmp/react-zlib-js_2.0.0_1768457591464_0.74379450442392","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"name":"react-zlib-js","version":"2.0.1","keywords":["Nodejs","Core","Zlib","Gzip","Brotli","compression","deflate","inflate","react-native"],"author":{"name":"Anuragh K.P"},"license":"MIT","_id":"react-zlib-js@2.0.1","maintainers":[{"name":"kpanuragh","email":"kpanuragh@gmail.com"},{"name":"nanduldas","email":"nanduldas@gmail.com"}],"homepage":"https://github.com/anuraghkp1/zlib#readme","bugs":{"url":"https://github.com/anuraghkp1/zlib/issues"},"dist":{"shasum":"7e654e398eb52c15d84654c2ff8e76a8b1173162","tarball":"https://registry.npmjs.org/react-zlib-js/-/react-zlib-js-2.0.1.tgz","fileCount":12,"integrity":"sha512-EhW4SL0QGynZ2z9C4gOCxLcu5o/n13cTpVlHTZXo4IMUHGLUI8MR2AzyCPPIM9a9SJq/HkxPYS2bDsJFa60n4g==","signatures":[{"sig":"MEQCIGHm1QszQ7MHLvbmbwk+W9xKmSHXDz0JCJLQeKt1BMuyAiA+CBMjwSYZkVsP9T7WYybgU2/cgdPj0/v5nWoIDGQV9A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1481224},"main":"index.js","gitHead":"275c49550449e6855a5e7a5b9495ff1a29029c6d","scripts":{"test":"node test.js","build":"browserify src/entry.js -s zlib -o index.js","build:buffer":"browserify node_modules/buffer/index.js -s buffer -o buffer.js"},"_npmUser":{"name":"kpanuragh","email":"kpanuragh@gmail.com"},"repository":{"url":"git+https://github.com/anuraghkp1/zlib.git","type":"git"},"_npmVersion":"11.6.1","description":"Pure javascript implementation of Zlib nodejs core module. The zlib module provides compression functionality implemented using Gzip, Deflate/Inflate, and Brotli. Compatible with Node.js 22.x LTS.","directories":{},"_nodeVersion":"24.11.0","dependencies":{"pako":"^1.0.11","brotli":"^1.3.3"},"_hasShrinkwrap":false,"devDependencies":{"browserify":"^17.0.0"},"_npmOperationalInternal":{"tmp":"tmp/react-zlib-js_2.0.1_1774378651529_0.30478612422057694","host":"s3://npm-registry-packages-npm-production"}},"2.1.0":{"name":"react-zlib-js","version":"2.1.0","keywords":["Nodejs","Core","Zlib","Gzip","Brotli","compression","deflate","inflate","react-native"],"author":{"name":"Anuragh K.P"},"license":"MIT","_id":"react-zlib-js@2.1.0","maintainers":[{"name":"kpanuragh","email":"kpanuragh@gmail.com"},{"name":"nanduldas","email":"nanduldas@gmail.com"}],"homepage":"https://github.com/anuraghkp1/zlib#readme","bugs":{"url":"https://github.com/anuraghkp1/zlib/issues"},"dist":{"shasum":"74973237384c18e678a271c7c152dfe8b7b99217","tarball":"https://registry.npmjs.org/react-zlib-js/-/react-zlib-js-2.1.0.tgz","fileCount":16,"integrity":"sha512-ZK9de/oWMN5YxVoV7cW5q1lqcb/D0c8D45iboXMZoxTpQND4mWPwo9EsA9auAP6t2hdPGb099GSc0wH6gOs6yw==","signatures":[{"sig":"MEYCIQCJqpyQIwWyQqz51pk5WPc/cgWdHnzY/AmngUGEvBsmFAIhAOVYvCcOgcumpbXtmG1P/5J/nUrciry9WImZBZ6BMNwf","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1533268},"main":"index.js","types":"./index.d.ts","gitHead":"b03d73ec7a3a0e6af35d71e070cbb8ea28ad0f20","scripts":{"test":"node test.js","build":"browserify src/entry.js -s zlib -o index.js","build:buffer":"browserify node_modules/buffer/index.js -s buffer -o buffer.js"},"_npmUser":{"name":"kpanuragh","email":"kpanuragh@gmail.com"},"repository":{"url":"git+https://github.com/anuraghkp1/zlib.git","type":"git"},"_npmVersion":"11.6.1","description":"Pure javascript implementation of Zlib nodejs core module. The zlib module provides compression functionality implemented using Gzip, Deflate/Inflate, and Brotli. Compatible with Node.js 22.x LTS.","directories":{},"_nodeVersion":"24.11.0","dependencies":{"pako":"^1.0.11","brotli":"^1.3.3"},"_hasShrinkwrap":false,"devDependencies":{"browserify":"^17.0.0","@types/node":"^25.5.0"},"_npmOperationalInternal":{"tmp":"tmp/react-zlib-js_2.1.0_1774380713463_0.26514734256113237","host":"s3://npm-registry-packages-npm-production"}},"3.0.0":{"name":"react-zlib-js","version":"3.0.0","description":"Pure JavaScript implementation of the Node.js zlib core module: Gzip, Deflate/Inflate, Brotli and Zstd decompression, for React Native and the browser. API-compatible with Node.js 22.x LTS.","main":"src/index.js","browser":"index.js","react-native":"index.js","types":"index.d.ts","scripts":{"build":"browserify src/zlib.js -s zlib -o index.js","build:buffer":"browserify node_modules/buffer/index.js -s buffer -o buffer.js","build:constants":"node scripts/gen-constants.js > src/constants.js","test":"node scripts/run-tests.js","test:src":"node scripts/run-tests.js src","test:bundle":"node scripts/run-tests.js bundle","prepublishOnly":"npm run build && npm test","build:types":"node scripts/gen-types.js > index.d.ts"},"repository":{"type":"git","url":"git+https://github.com/anuraghkp1/zlib.git"},"keywords":["Nodejs","Core","Zlib","Gzip","Brotli","Zstd","compression","deflate","inflate","react-native"],"author":{"name":"Anuragh K.P"},"license":"MIT","bugs":{"url":"https://github.com/anuraghkp1/zlib/issues"},"homepage":"https://github.com/anuraghkp1/zlib#readme","engines":{"node":">=18"},"dependencies":{"brotli":"^1.3.3","fzstd":"^0.1.1","pako":"^1.0.11"},"devDependencies":{"@types/node":"^25.5.0","browserify":"^17.0.0"},"_id":"react-zlib-js@3.0.0","gitHead":"8182b06c6669ff64296037909af6052d7a79cc0c","_nodeVersion":"22.23.2","_npmVersion":"10.9.8","dist":{"integrity":"sha512-/YzVCzwr5pVgI13tbxAXDUE21dcS/iAC6rnHcNimhd6yC/7UdniZrATSgXKP77S58tnH+/B6DKSd4A/HkjOejg==","shasum":"ef92c547b93d6045d002b370d88016185b7e6144","tarball":"https://registry.npmjs.org/react-zlib-js/-/react-zlib-js-3.0.0.tgz","fileCount":15,"unpackedSize":1545376,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCtzNU9nsXOdP8iSFBRv/ggzuEdFlqxJfKRyuGn8hu3bQIhAJ81MtWHR18q03huk3MICcPVZSVGkvsqt16/aAHJI1Zx"}]},"_npmUser":{"name":"kpanuragh","email":"kpanuragh@gmail.com"},"directories":{},"maintainers":[{"name":"kpanuragh","email":"kpanuragh@gmail.com"},{"name":"nanduldas","email":"nanduldas@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/react-zlib-js_3.0.0_1788943293618_0.928839830548319"},"_hasShrinkwrap":false}},"time":{"created":"2018-04-17T11:55:30.440Z","modified":"2026-09-09T08:41:33.958Z","1.0.0":"2018-04-17T11:55:30.571Z","1.0.1":"2018-04-17T12:42:29.567Z","1.0.2":"2018-04-17T12:53:28.794Z","1.0.3":"2018-04-18T05:12:49.146Z","1.0.4":"2018-04-20T11:35:12.254Z","1.0.5":"2020-08-18T11:51:53.733Z","2.0.0":"2026-01-15T06:13:11.626Z","2.0.1":"2026-03-24T18:57:31.688Z","2.1.0":"2026-03-24T19:31:53.637Z","3.0.0":"2026-09-09T08:41:33.813Z"},"bugs":{"url":"https://github.com/anuraghkp1/zlib/issues"},"author":{"name":"Anuragh K.P"},"license":"MIT","homepage":"https://github.com/anuraghkp1/zlib#readme","keywords":["Nodejs","Core","Zlib","Gzip","Brotli","Zstd","compression","deflate","inflate","react-native"],"repository":{"type":"git","url":"git+https://github.com/anuraghkp1/zlib.git"},"description":"Pure JavaScript implementation of the Node.js zlib core module: Gzip, Deflate/Inflate, Brotli and Zstd decompression, for React Native and the browser. API-compatible with Node.js 22.x LTS.","maintainers":[{"name":"kpanuragh","email":"kpanuragh@gmail.com"},{"name":"nanduldas","email":"nanduldas@gmail.com"}],"readme":"# react-zlib-js\n\n[![npm version](https://badge.fury.io/js/react-zlib-js.svg)](https://www.npmjs.com/package/react-zlib-js)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nPure JavaScript implementation of Node.js `zlib` module for React Native, browsers, and JavaScript environments where native modules are not available.\n\n**Matches the Node.js 22.x LTS `zlib` surface**, including Zstd decompression, `maxOutputLength`, `info`, `bytesWritten`, and Node's `ERR_*` error codes. The test suite verifies this by diffing against the host's real `zlib` and round-tripping every codec against Node's native implementation.\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Quick Start](#quick-start)\n- [Promise-Based API](#promise-based-api)\n- [API Reference](#api-reference)\n  - [Convenience Methods (Async)](#convenience-methods-async)\n  - [Convenience Methods (Sync)](#convenience-methods-sync)\n  - [Stream Factory Methods](#stream-factory-methods)\n  - [Stream Classes](#stream-classes)\n  - [Instance Properties and Methods](#instance-properties-and-methods)\n  - [Utility Functions](#utility-functions)\n- [Options](#options)\n- [Error Handling](#error-handling)\n- [Constants](#constants)\n- [Examples](#examples)\n- [Limitations](#limitations)\n- [Compression Comparison](#compression-comparison)\n- [React Native Usage](#react-native-usage)\n- [Browser Usage](#browser-usage)\n- [Building from Source](#building-from-source)\n- [Migration to v3.x](#migration-to-v3x)\n- [Migration from v1.x](#migration-from-v1x)\n- [Troubleshooting](#troubleshooting)\n- [License](#license)\n\n## Features\n\n| Feature | Description | Node.js Version |\n|---------|-------------|-----------------|\n| **Gzip/Gunzip** | Standard gzip compression | All |\n| **Deflate/Inflate** | Raw deflate with zlib header | All |\n| **DeflateRaw/InflateRaw** | Raw deflate without header | All |\n| **Unzip** | Auto-detect and decompress | All |\n| **Brotli** | Modern compression, better ratios | 11.7.0+ |\n| **Zstd** | Decompression only - see [Limitations](#limitations) | 22.15.0+ |\n| **CRC32** | Checksum calculation | 22.2.0+ |\n| **Stream Support** | Node.js Transform streams | All |\n| **Sync, callback & promise APIs** | Promises are this package's own addition | All |\n| **`maxOutputLength`** | Caps output, throws `ERR_BUFFER_TOO_LARGE` | 12.19.0+ |\n| **`info: true`** | Returns `{ buffer, engine }` | 12.19.0+ |\n| **`bytesWritten`** | Bytes fed to the engine | All |\n| **Node `ERR_*` error codes** | Same code, prototype and message text | All |\n\n## Installation\n\n```bash\nnpm install react-zlib-js\n```\n\nOr with yarn:\n\n```bash\nyarn add react-zlib-js\n```\n\n## Quick Start\n\n```javascript\nconst zlib = require('react-zlib-js');\n\n// ============================================\n// Gzip Compression\n// ============================================\n\n// Async\nzlib.gzip('Hello, World!', (err, compressed) => {\n  if (err) throw err;\n\n  zlib.gunzip(compressed, (err, decompressed) => {\n    console.log(decompressed.toString()); // 'Hello, World!'\n  });\n});\n\n// Sync\nconst compressed = zlib.gzipSync('Hello, World!');\nconst decompressed = zlib.gunzipSync(compressed);\nconsole.log(decompressed.toString()); // 'Hello, World!'\n\n// ============================================\n// Brotli Compression (Better compression ratio)\n// ============================================\n\nconst brotliCompressed = zlib.brotliCompressSync('Hello, World!');\nconst brotliDecompressed = zlib.brotliDecompressSync(brotliCompressed);\nconsole.log(brotliDecompressed.toString()); // 'Hello, World!'\n\n// ============================================\n// CRC32 Checksum\n// ============================================\n\nconst checksum = zlib.crc32('Hello, World!');\nconsole.log(checksum); // 3964322768\n\n// ============================================\n// Zstd Decompression\n// ============================================\n\n// Decoding is supported; encoding is not - see Limitations\nconst zstdDecompressed = zlib.zstdDecompressSync(zstdPayload);\nconsole.log(zstdDecompressed.toString());\n\n// ============================================\n// Promises\n// ============================================\n\n// Omit the callback and you get a promise back\nasync function roundTrip() {\n  const gzipped = await zlib.gzip('Hello, World!');\n  console.log((await zlib.gunzip(gzipped)).toString()); // 'Hello, World!'\n}\n```\n\n## Promise-Based API\n\nAll async methods now support both promises and callbacks, allowing you to use modern async/await syntax without manual promise wrapping.\n\n### Using async/await\n\n```javascript\nconst zlib = require('react-zlib-js');\n\nasync function compress() {\n  try {\n    const data = 'Hello, World!';\n\n    // Gzip compression with async/await\n    const compressed = await zlib.gzip(data);\n    const decompressed = await zlib.gunzip(compressed);\n    console.log(decompressed.toString()); // 'Hello, World!'\n\n    // With compression level\n    const fast = await zlib.gzip(data, { level: 1 });\n    const best = await zlib.gzip(data, { level: 9 });\n\n    // Brotli compression\n    const brotli = await zlib.brotliCompress(data);\n    const unbrotli = await zlib.brotliDecompress(brotli);\n\n  } catch (err) {\n    console.error('Compression failed:', err);\n  }\n}\n\ncompress();\n```\n\n### Both patterns work together\n\nYou can mix promises and callbacks in the same codebase:\n\n```javascript\nconst zlib = require('react-zlib-js');\n\nasync function mixedPatterns() {\n  // Promise pattern with async/await\n  const compressed = await zlib.gzip('data');\n\n  // Callback pattern still works\n  zlib.gzip('data', (err, result) => {\n    if (err) console.error(err);\n    else console.log(result);\n  });\n\n  // Mix both patterns in the same code\n  try {\n    const compressed = await zlib.gzip('data');\n    zlib.deflate('data', (err, result) => {\n      // both work together seamlessly\n    });\n  } catch (err) {\n    console.error(err);\n  }\n}\n\nmixedPatterns();\n```\n\n## API Reference\n\n### Convenience Methods (Async)\n\nAll async methods follow the pattern: `method(buffer[, options], callback)`\n\n```javascript\n// Callback signature: (error, result) => void\n```\n\n| Method | Description |\n|--------|-------------|\n| `zlib.gzip(buffer[, options], callback)` | Compress using Gzip |\n| `zlib.gunzip(buffer[, options], callback)` | Decompress Gzip |\n| `zlib.deflate(buffer[, options], callback)` | Compress using Deflate |\n| `zlib.inflate(buffer[, options], callback)` | Decompress Deflate |\n| `zlib.deflateRaw(buffer[, options], callback)` | Compress using raw Deflate (no header) |\n| `zlib.inflateRaw(buffer[, options], callback)` | Decompress raw Deflate |\n| `zlib.unzip(buffer[, options], callback)` | Auto-detect and decompress (gzip or deflate) |\n| `zlib.brotliCompress(buffer[, options], callback)` | Compress using Brotli |\n| `zlib.brotliDecompress(buffer[, options], callback)` | Decompress Brotli |\n| `zlib.zstdDecompress(buffer[, options], callback)` | Decompress Zstd |\n| `zlib.zstdCompress(buffer[, options], callback)` | Throws - see [Limitations](#limitations) |\n\nOmit the callback and the same methods return a promise. Input may be a\nstring, `Buffer`, `TypedArray`, `DataView` or `ArrayBuffer`.\n\n**Example:**\n\n```javascript\nzlib.gzip('Hello', { level: 9 }, (err, result) => {\n  if (err) {\n    console.error('Compression failed:', err);\n    return;\n  }\n  console.log('Compressed size:', result.length);\n});\n```\n\n### Convenience Methods (Sync)\n\nAll sync methods follow the pattern: `methodSync(buffer[, options])`\n\n| Method | Description |\n|--------|-------------|\n| `zlib.gzipSync(buffer[, options])` | Compress using Gzip |\n| `zlib.gunzipSync(buffer[, options])` | Decompress Gzip |\n| `zlib.deflateSync(buffer[, options])` | Compress using Deflate |\n| `zlib.inflateSync(buffer[, options])` | Decompress Deflate |\n| `zlib.deflateRawSync(buffer[, options])` | Compress using raw Deflate |\n| `zlib.inflateRawSync(buffer[, options])` | Decompress raw Deflate |\n| `zlib.unzipSync(buffer[, options])` | Auto-detect and decompress |\n| `zlib.brotliCompressSync(buffer[, options])` | Compress using Brotli |\n| `zlib.brotliDecompressSync(buffer[, options])` | Decompress Brotli |\n| `zlib.zstdDecompressSync(buffer[, options])` | Decompress Zstd |\n| `zlib.zstdCompressSync(buffer[, options])` | Throws - see [Limitations](#limitations) |\n\n**Example:**\n\n```javascript\ntry {\n  const compressed = zlib.gzipSync('Hello', { level: 9 });\n  const decompressed = zlib.gunzipSync(compressed);\n  console.log(decompressed.toString());\n} catch (err) {\n  console.error('Error:', err);\n}\n```\n\n### Stream Factory Methods\n\nCreate Transform streams for piping data.\n\n| Method | Description |\n|--------|-------------|\n| `zlib.createGzip([options])` | Create Gzip compression stream |\n| `zlib.createGunzip([options])` | Create Gzip decompression stream |\n| `zlib.createDeflate([options])` | Create Deflate compression stream |\n| `zlib.createInflate([options])` | Create Deflate decompression stream |\n| `zlib.createDeflateRaw([options])` | Create raw Deflate compression stream |\n| `zlib.createInflateRaw([options])` | Create raw Deflate decompression stream |\n| `zlib.createUnzip([options])` | Create auto-detect decompression stream |\n| `zlib.createBrotliCompress([options])` | Create Brotli compression stream |\n| `zlib.createBrotliDecompress([options])` | Create Brotli decompression stream |\n| `zlib.createZstdDecompress([options])` | Create Zstd decompression stream |\n| `zlib.createZstdCompress([options])` | Throws - see [Limitations](#limitations) |\n\n**Example:**\n\n```javascript\nconst gzip = zlib.createGzip();\nconst gunzip = zlib.createGunzip();\n\n// Pipe data through compression and decompression\ninputStream.pipe(gzip).pipe(gunzip).pipe(outputStream);\n```\n\n### Stream Classes\n\nDirect class constructors (also available via factory methods).\n\n| Class | Description |\n|-------|-------------|\n| `zlib.Gzip` | Gzip compression class |\n| `zlib.Gunzip` | Gzip decompression class |\n| `zlib.Deflate` | Deflate compression class |\n| `zlib.Inflate` | Deflate decompression class |\n| `zlib.DeflateRaw` | Raw Deflate compression class |\n| `zlib.InflateRaw` | Raw Deflate decompression class |\n| `zlib.Unzip` | Auto-detect decompression class |\n| `zlib.BrotliCompress` | Brotli compression class |\n| `zlib.BrotliDecompress` | Brotli decompression class |\n| `zlib.ZstdDecompress` | Zstd decompression class |\n| `zlib.ZstdCompress` | Present for API parity; constructing it throws |\n\nEvery class also carries Node's instance API: `bytesWritten`, `bytesRead`,\n`close()`, `flush()`, `reset()`, `params()` and `destroy()`.\n\n**Example:**\n\n```javascript\nconst gzip = new zlib.Gzip({ level: 9 });\n```\n\n### Instance Properties and Methods\n\nEvery stream instance carries Node's instance API.\n\n| Member | Description |\n|--------|-------------|\n| `stream.bytesWritten` | Bytes handed to the engine, before compression or decompression |\n| `stream.bytesRead` | Deprecated alias for `bytesWritten`, kept for parity |\n| `stream.close([callback])` | Release the underlying handle and emit `close` |\n| `stream.flush([kind][, callback])` | Flush buffered data with the given flush constant |\n| `stream.reset()` | Reset the stream to its initial state |\n| `stream.params(level, strategy[, callback])` | Retune compression level and strategy mid-stream |\n| `stream.destroy([error])` | Standard stream teardown |\n\n#### `bytesWritten`\n\nCounts input, not output, matching Node:\n\n```javascript\nconst gzip = zlib.createGzip();\ngzip.on('end', () => {\n  console.log(gzip.bytesWritten); // 1000 - the uncompressed size\n});\ngzip.end('x'.repeat(1000));\n```\n\n#### `params(level, strategy[, callback])`\n\nChanges the compression level and strategy partway through a deflate stream.\nData already emitted keeps the old settings; everything after uses the new\nones. The result is a single valid stream.\n\n```javascript\nconst deflate = zlib.createDeflate({ level: 1 });\n\ndeflate.write(headerChunk);              // compressed fast\ndeflate.params(9, zlib.Z_DEFAULT_STRATEGY, () => {\n  deflate.end(bodyChunk);                // compressed hard\n});\n```\n\nOnly meaningful on the deflate family. On Brotli it is a no-op that invokes\nthe callback, as Node's is.\n\n### Utility Functions\n\n#### `zlib.crc32(data[, value])`\n\nComputes a 32-bit CRC checksum (IEEE CRC-32 polynomial).\n\n**Parameters:**\n- `data` `<string>` | `<Buffer>` | `<TypedArray>` | `<DataView>` - Input data\n- `value` `<number>` - Optional starting CRC value for chaining (default: 0)\n\n**Returns:** `<number>` - 32-bit unsigned integer\n\n**Example:**\n\n```javascript\n// Basic usage\nconst crc = zlib.crc32('hello');\nconsole.log(crc);  // 907060870\n\n// With Buffer\nconst crc2 = zlib.crc32(Buffer.from('hello'));\nconsole.log(crc2); // 907060870\n\n// Chained CRC32 for streaming\nlet runningCrc = zlib.crc32('hello');\nrunningCrc = zlib.crc32(' world', runningCrc);\nconsole.log(runningCrc); // Combined checksum\n```\n\n## Options\n\n### Zlib Options (Gzip, Deflate, etc.)\n\n```javascript\n{\n  // Flush behavior during compression\n  flush: zlib.Z_NO_FLUSH,\n\n  // Flush behavior at end of stream\n  finishFlush: zlib.Z_FINISH,\n\n  // Internal buffer size (default: 16KB)\n  chunkSize: 16 * 1024,\n\n  // Window size bits: 9-15 (default: 15)\n  // Higher = better compression, more memory\n  windowBits: 15,\n\n  // Compression level: -1 to 9\n  // -1 = default, 0 = none, 1 = fastest, 9 = best\n  level: zlib.Z_DEFAULT_COMPRESSION,\n\n  // Memory usage level: 1-9 (default: 8)\n  // Higher = faster, more memory\n  memLevel: 8,\n\n  // Compression strategy\n  strategy: zlib.Z_DEFAULT_STRATEGY,\n\n  // Preset dictionary for compression\n  dictionary: Buffer,\n\n  // Cap the output; exceeding it throws ERR_BUFFER_TOO_LARGE\n  // (default: buffer.kMaxLength)\n  maxOutputLength: 1024 * 1024,\n\n  // Return { buffer, engine } instead of just the buffer\n  info: false\n}\n```\n\nNote that `windowBits` accepts 9 to 15, matching Node. Only `inflateRaw`\nalso accepts 8.\n\n**`maxOutputLength`** guards against decompression bombs. It applies to the\nsync, callback and promise forms alike:\n\n```javascript\ntry {\n  zlib.gunzipSync(untrusted, { maxOutputLength: 10 * 1024 * 1024 });\n} catch (err) {\n  if (err.code === 'ERR_BUFFER_TOO_LARGE') {\n    console.error('Refusing to decompress: output too large');\n  }\n}\n\n// Asynchronously, the same condition arrives as an error\nzlib.gunzip(untrusted, { maxOutputLength: 10 * 1024 * 1024 })\n  .catch(err => console.error(err.code)); // 'ERR_BUFFER_TOO_LARGE'\n```\n\n**`info: true`** returns the engine alongside the output, which is how you\nreach `bytesWritten` from a one-shot call:\n\n```javascript\nconst { buffer, engine } = zlib.gzipSync(data, { info: true });\nconsole.log(buffer.length, 'bytes out of', engine.bytesWritten, 'in');\n```\n\n**Compression Level Examples:**\n\n```javascript\n// No compression (fastest, largest output)\nzlib.deflateSync(data, { level: zlib.Z_NO_COMPRESSION });\n\n// Best speed (level 1)\nzlib.deflateSync(data, { level: zlib.Z_BEST_SPEED });\n\n// Best compression (level 9, slowest)\nzlib.deflateSync(data, { level: zlib.Z_BEST_COMPRESSION });\n\n// Default (level 6, balanced)\nzlib.deflateSync(data, { level: zlib.Z_DEFAULT_COMPRESSION });\n```\n\n### Brotli Options\n\n```javascript\n{\n  // Flush behavior during compression\n  flush: zlib.BROTLI_OPERATION_PROCESS,\n\n  // Flush behavior at end of stream\n  finishFlush: zlib.BROTLI_OPERATION_FINISH,\n\n  // Internal buffer size\n  chunkSize: 16 * 1024,\n\n  // Brotli-specific parameters\n  params: {\n    // Compression mode\n    [zlib.BROTLI_PARAM_MODE]: zlib.BROTLI_MODE_GENERIC,\n\n    // Quality: 0-11 (default: 11)\n    [zlib.BROTLI_PARAM_QUALITY]: 11,\n\n    // Window size bits: 10-24 (default: 22)\n    [zlib.BROTLI_PARAM_LGWIN]: 22,\n\n    // Block size bits: 16-24\n    [zlib.BROTLI_PARAM_LGBLOCK]: 0,\n\n    // Input size hint (optional)\n    [zlib.BROTLI_PARAM_SIZE_HINT]: 0\n  }\n}\n```\n\n**Brotli Mode Examples:**\n\n```javascript\n// Generic mode (default)\nzlib.brotliCompressSync(data, {\n  params: { [zlib.BROTLI_PARAM_MODE]: zlib.BROTLI_MODE_GENERIC }\n});\n\n// Text mode (optimized for UTF-8 text)\nzlib.brotliCompressSync(data, {\n  params: { [zlib.BROTLI_PARAM_MODE]: zlib.BROTLI_MODE_TEXT }\n});\n\n// Font mode (optimized for WOFF 2.0)\nzlib.brotliCompressSync(fontData, {\n  params: { [zlib.BROTLI_PARAM_MODE]: zlib.BROTLI_MODE_FONT }\n});\n```\n\n### Zstd Options\n\nDecompression only. See [Limitations](#limitations).\n\n```javascript\n{\n  flush: zlib.constants.ZSTD_e_continue,\n  finishFlush: zlib.constants.ZSTD_e_end,\n  chunkSize: 16 * 1024,\n  maxOutputLength: 1024 * 1024,\n\n  params: {\n    // Maximum window size the decoder will accept\n    [zlib.constants.ZSTD_d_windowLogMax]: 27\n  }\n}\n```\n\n```javascript\n// Decode a zstd payload from a server\nasync function decode(payload) {\n  return zlib.zstdDecompress(payload);\n}\n\n// Or as a stream - this one decodes incrementally\nresponse.pipe(zlib.createZstdDecompress()).pipe(destination);\n```\n\n## Error Handling\n\nErrors carry the same `code`, prototype and message text as Node's, so code\nthat branches on `err.code` works unchanged.\n\n### Validation errors\n\nThrown synchronously, from the sync, callback and promise forms alike.\n\n| Code | Type | Raised when |\n|------|------|-------------|\n| `ERR_INVALID_ARG_TYPE` | `TypeError` | Input is not a string, `Buffer`, `TypedArray`, `DataView` or `ArrayBuffer`; or an option has the wrong type |\n| `ERR_OUT_OF_RANGE` | `RangeError` | `level`, `windowBits`, `memLevel`, `strategy`, `chunkSize` or `flush` is outside its range |\n| `ERR_BUFFER_TOO_LARGE` | `RangeError` | Output exceeded `maxOutputLength` |\n| `ERR_BROTLI_INVALID_PARAM` | `RangeError` | Unknown key in a Brotli `params` object |\n| `ERR_ZSTD_INVALID_PARAM` | `RangeError` | Unknown key in a Zstd `params` object |\n| `ERR_METHOD_NOT_IMPLEMENTED` | `Error` | Zstd compression was attempted |\n| `ERR_ZLIB_INITIALIZATION_FAILED` | `Error` | The engine could not be initialised |\n\n```javascript\ntry {\n  zlib.gzipSync(data, { level: 12 });\n} catch (err) {\n  console.log(err.code);    // 'ERR_OUT_OF_RANGE'\n  console.log(err.message); // 'The value of \"options.level\" is out of range. ...'\n}\n```\n\n### Stream errors\n\nCorrupt input reports the underlying zlib return code, reaching you through\nthe callback, the rejected promise, or the stream's `error` event.\n\n| Code | Meaning |\n|------|---------|\n| `Z_DATA_ERROR` | Input is corrupt or not in the expected format |\n| `Z_BUF_ERROR` | No progress was possible |\n| `Z_NEED_DICT` | A preset dictionary is required |\n| `Z_STREAM_ERROR` | Inconsistent stream state |\n\n`err.errno` carries the numeric code, and `zlib.codes` maps between the two.\n\n```javascript\n// Promise form\nzlib.gunzip(corrupt).catch(err => {\n  console.log(err.code, err.errno); // 'Z_DATA_ERROR' -3\n});\n\n// Callback form\nzlib.brotliDecompress(corrupt, (err, result) => {\n  if (err) console.error('Could not decode:', err.message);\n});\n\n// Stream form\nzlib.createGunzip()\n  .on('error', err => console.error(err.code))\n  .end(corrupt);\n```\n\nNote that corrupt Brotli and Zstd input reaches your callback or rejects your\npromise. In 2.x it crashed the process.\n\n## Constants\n\nAll 176 constants are available both directly on `zlib` and via\n`zlib.constants`, which includes every one of Node's 170 with identical\nvalues. Direct properties are non-enumerable, as Node's are.\n\n### Compression Levels\n\n| Constant | Value | Description |\n|----------|-------|-------------|\n| `Z_NO_COMPRESSION` | 0 | No compression, store only |\n| `Z_BEST_SPEED` | 1 | Fastest compression |\n| `Z_BEST_COMPRESSION` | 9 | Best compression ratio |\n| `Z_DEFAULT_COMPRESSION` | -1 | Default level (6) |\n\n### Flush Values\n\n| Constant | Value | Description |\n|----------|-------|-------------|\n| `Z_NO_FLUSH` | 0 | Normal operation |\n| `Z_PARTIAL_FLUSH` | 1 | Partial flush |\n| `Z_SYNC_FLUSH` | 2 | Sync to byte boundary |\n| `Z_FULL_FLUSH` | 3 | Full flush, reset state |\n| `Z_FINISH` | 4 | Finish compression |\n| `Z_BLOCK` | 5 | Block flush |\n\n### Return Codes\n\n| Constant | Value | Description |\n|----------|-------|-------------|\n| `Z_OK` | 0 | Success |\n| `Z_STREAM_END` | 1 | Stream complete |\n| `Z_NEED_DICT` | 2 | Dictionary needed |\n| `Z_ERRNO` | -1 | System error |\n| `Z_STREAM_ERROR` | -2 | Stream state error |\n| `Z_DATA_ERROR` | -3 | Data corruption |\n| `Z_MEM_ERROR` | -4 | Out of memory |\n| `Z_BUF_ERROR` | -5 | Buffer error |\n| `Z_VERSION_ERROR` | -6 | Version mismatch |\n\n### Strategies\n\n| Constant | Value | Description |\n|----------|-------|-------------|\n| `Z_FILTERED` | 1 | For filtered data (e.g., images) |\n| `Z_HUFFMAN_ONLY` | 2 | Huffman encoding only |\n| `Z_RLE` | 3 | Run-length encoding |\n| `Z_FIXED` | 4 | Fixed Huffman codes |\n| `Z_DEFAULT_STRATEGY` | 0 | Default strategy |\n\n### Brotli Operations\n\n| Constant | Value | Description |\n|----------|-------|-------------|\n| `BROTLI_OPERATION_PROCESS` | 0 | Normal processing |\n| `BROTLI_OPERATION_FLUSH` | 1 | Flush output |\n| `BROTLI_OPERATION_FINISH` | 2 | Finish stream |\n| `BROTLI_OPERATION_EMIT_METADATA` | 3 | Emit metadata block |\n\n### Brotli Modes\n\n| Constant | Value | Description |\n|----------|-------|-------------|\n| `BROTLI_MODE_GENERIC` | 0 | Generic compression |\n| `BROTLI_MODE_TEXT` | 1 | UTF-8 text optimization |\n| `BROTLI_MODE_FONT` | 2 | WOFF 2.0 font optimization |\n\n### Brotli Quality\n\n| Constant | Value | Description |\n|----------|-------|-------------|\n| `BROTLI_MIN_QUALITY` | 0 | Minimum (fastest) |\n| `BROTLI_MAX_QUALITY` | 11 | Maximum (best compression) |\n| `BROTLI_DEFAULT_QUALITY` | 11 | Default quality |\n\n### Brotli Window Size\n\n| Constant | Value | Description |\n|----------|-------|-------------|\n| `BROTLI_MIN_WINDOW_BITS` | 10 | Minimum window (1KB) |\n| `BROTLI_MAX_WINDOW_BITS` | 24 | Maximum window (16MB) |\n| `BROTLI_LARGE_MAX_WINDOW_BITS` | 30 | Large window (1GB) |\n| `BROTLI_DEFAULT_WINDOW` | 22 | Default window (4MB) |\n\n### Brotli Parameters\n\n| Constant | Value | Description |\n|----------|-------|-------------|\n| `BROTLI_PARAM_MODE` | 0 | Compression mode |\n| `BROTLI_PARAM_QUALITY` | 1 | Quality level (0-11) |\n| `BROTLI_PARAM_LGWIN` | 2 | Window size bits |\n| `BROTLI_PARAM_LGBLOCK` | 3 | Block size bits |\n| `BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING` | 4 | Disable context modeling |\n| `BROTLI_PARAM_SIZE_HINT` | 5 | Input size hint |\n| `BROTLI_PARAM_LARGE_WINDOW` | 6 | Enable large window |\n| `BROTLI_PARAM_NPOSTFIX` | 7 | Postfix bits |\n| `BROTLI_PARAM_NDIRECT` | 8 | Direct distance codes |\n\n### Brotli Decoder Parameters\n\n| Constant | Value | Description |\n|----------|-------|-------------|\n| `BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION` | 0 | Disable buffer realloc |\n| `BROTLI_DECODER_PARAM_LARGE_WINDOW` | 1 | Enable large window |\n\n### Brotli Decoder Results\n\n| Constant | Value | Description |\n|----------|-------|-------------|\n| `BROTLI_DECODER_RESULT_ERROR` | 0 | Decoding error |\n| `BROTLI_DECODER_RESULT_SUCCESS` | 1 | Success |\n| `BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT` | 2 | Need more input |\n| `BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT` | 3 | Need more output |\n\n### Zstd Constants\n\nAll 72 of Node's `ZSTD_*` constants are present. The ones you are likely to\nuse:\n\n| Constant | Value | Description |\n|----------|-------|-------------|\n| `ZSTD_e_continue` | 0 | Keep accepting input |\n| `ZSTD_e_flush` | 1 | Flush what has been buffered |\n| `ZSTD_e_end` | 2 | Finish the frame |\n| `ZSTD_d_windowLogMax` | 100 | Largest window the decoder will accept |\n| `ZSTD_c_compressionLevel` | 100 | Compression level (encoding is unavailable) |\n| `ZSTD_CLEVEL_DEFAULT` | 3 | Default compression level |\n\nThe full set also covers every `ZSTD_c_*` compression parameter, the\n`ZSTD_error_*` codes and the `ZSTD_fast` through `ZSTD_btultra2` strategies.\n\n### Accessing Constants\n\n```javascript\n// Direct access\nconsole.log(zlib.Z_BEST_COMPRESSION);      // 9\nconsole.log(zlib.BROTLI_MAX_QUALITY);      // 11\n\n// Via constants object\nconsole.log(zlib.constants.Z_BEST_COMPRESSION);  // 9\nconsole.log(zlib.constants.BROTLI_MAX_QUALITY);  // 11\n\n// Error codes with reverse lookup\nconsole.log(zlib.codes.Z_OK);     // 0\nconsole.log(zlib.codes[0]);       // 'Z_OK'\nconsole.log(zlib.codes[-3]);      // 'Z_DATA_ERROR'\n```\n\n## Examples\n\n### Basic Compression/Decompression\n\n```javascript\nconst zlib = require('react-zlib-js');\n\nconst original = 'Hello, World! This is a test string for compression.';\n\n// Gzip\nconst gzipped = zlib.gzipSync(original);\nconst ungzipped = zlib.gunzipSync(gzipped);\nconsole.log('Gzip:', original.length, '->', gzipped.length, 'bytes');\nconsole.log('Match:', ungzipped.toString() === original);\n\n// Deflate\nconst deflated = zlib.deflateSync(original);\nconst inflated = zlib.inflateSync(deflated);\nconsole.log('Deflate:', original.length, '->', deflated.length, 'bytes');\n\n// Brotli (best compression)\nconst brotlied = zlib.brotliCompressSync(original);\nconst unbrotlied = zlib.brotliDecompressSync(brotlied);\nconsole.log('Brotli:', original.length, '->', brotlied.length, 'bytes');\n```\n\n### Compression Levels Comparison\n\n```javascript\nconst zlib = require('react-zlib-js');\n\nconst data = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. '.repeat(100);\n\nconsole.log('Original size:', data.length, 'bytes\\n');\n\n// Different compression levels\nconst levels = [\n  { name: 'No compression', level: zlib.Z_NO_COMPRESSION },\n  { name: 'Best speed', level: zlib.Z_BEST_SPEED },\n  { name: 'Level 5', level: 5 },\n  { name: 'Default', level: zlib.Z_DEFAULT_COMPRESSION },\n  { name: 'Best compression', level: zlib.Z_BEST_COMPRESSION }\n];\n\nlevels.forEach(({ name, level }) => {\n  const compressed = zlib.deflateSync(data, { level });\n  const ratio = ((1 - compressed.length / data.length) * 100).toFixed(1);\n  console.log(`${name} (${level}): ${compressed.length} bytes (${ratio}% reduction)`);\n});\n```\n\n### Async Compression with Error Handling\n\n```javascript\nconst zlib = require('react-zlib-js');\n\nfunction compressData(data) {\n  return new Promise((resolve, reject) => {\n    zlib.gzip(data, (err, compressed) => {\n      if (err) reject(err);\n      else resolve(compressed);\n    });\n  });\n}\n\nfunction decompressData(data) {\n  return new Promise((resolve, reject) => {\n    zlib.gunzip(data, (err, decompressed) => {\n      if (err) reject(err);\n      else resolve(decompressed);\n    });\n  });\n}\n\n// Usage with async/await\nasync function example() {\n  try {\n    const original = 'Hello, World!';\n    const compressed = await compressData(original);\n    console.log('Compressed size:', compressed.length);\n\n    const decompressed = await decompressData(compressed);\n    console.log('Decompressed:', decompressed.toString());\n  } catch (err) {\n    console.error('Error:', err.message);\n  }\n}\n\nexample();\n```\n\n### Stream-based Compression\n\n```javascript\nconst zlib = require('react-zlib-js');\n\n// Compress using streams\nfunction compressWithStream(input) {\n  return new Promise((resolve, reject) => {\n    const gzip = zlib.createGzip();\n    const chunks = [];\n\n    gzip.on('data', chunk => chunks.push(chunk));\n    gzip.on('end', () => resolve(Buffer.concat(chunks)));\n    gzip.on('error', reject);\n\n    gzip.write(input);\n    gzip.end();\n  });\n}\n\n// Decompress using streams\nfunction decompressWithStream(input) {\n  return new Promise((resolve, reject) => {\n    const gunzip = zlib.createGunzip();\n    const chunks = [];\n\n    gunzip.on('data', chunk => chunks.push(chunk));\n    gunzip.on('end', () => resolve(Buffer.concat(chunks)));\n    gunzip.on('error', reject);\n\n    gunzip.write(input);\n    gunzip.end();\n  });\n}\n\n// Usage\nasync function streamExample() {\n  const original = 'Stream compression example data';\n\n  const compressed = await compressWithStream(original);\n  console.log('Compressed:', compressed.length, 'bytes');\n\n  const decompressed = await decompressWithStream(compressed);\n  console.log('Decompressed:', decompressed.toString());\n}\n\nstreamExample();\n```\n\n### Brotli with Custom Options\n\n```javascript\nconst zlib = require('react-zlib-js');\n\nconst text = 'This is UTF-8 text content for Brotli compression.'.repeat(50);\n\n// Fast compression (lower quality)\nconst fast = zlib.brotliCompressSync(text, {\n  params: {\n    [zlib.BROTLI_PARAM_QUALITY]: 1\n  }\n});\n\n// Best compression (highest quality)\nconst best = zlib.brotliCompressSync(text, {\n  params: {\n    [zlib.BROTLI_PARAM_MODE]: zlib.BROTLI_MODE_TEXT,\n    [zlib.BROTLI_PARAM_QUALITY]: zlib.BROTLI_MAX_QUALITY\n  }\n});\n\nconsole.log('Original:', text.length, 'bytes');\nconsole.log('Fast (Q1):', fast.length, 'bytes');\nconsole.log('Best (Q11):', best.length, 'bytes');\n```\n\n### Binary Data Compression\n\n```javascript\nconst zlib = require('react-zlib-js');\n\n// Create binary data\nconst binaryData = Buffer.alloc(1000);\nfor (let i = 0; i < binaryData.length; i++) {\n  binaryData[i] = Math.floor(Math.random() * 256);\n}\n\n// Compress\nconst compressed = zlib.gzipSync(binaryData);\n\n// Decompress\nconst decompressed = zlib.gunzipSync(compressed);\n\n// Verify\nconst match = Buffer.compare(binaryData, decompressed) === 0;\nconsole.log('Binary data preserved:', match);\nconsole.log('Original:', binaryData.length, 'bytes');\nconsole.log('Compressed:', compressed.length, 'bytes');\n```\n\n### Compression with Promises\n\nUsing async/await with promise-based API for cleaner, more readable code:\n\n```javascript\nconst zlib = require('react-zlib-js');\n\nasync function demonstratePromises() {\n  const original = 'Hello, World! This is a test string for compression.';\n\n  try {\n    // Gzip with promise\n    const gzipped = await zlib.gzip(original);\n    const ungzipped = await zlib.gunzip(gzipped);\n    console.log('Gzip match:', ungzipped.toString() === original);\n\n    // Deflate with promise\n    const deflated = await zlib.deflate(original);\n    const inflated = await zlib.inflate(deflated);\n    console.log('Deflate match:', inflated.toString() === original);\n\n    // DeflateRaw with promise\n    const deflateRaw = await zlib.deflateRaw(original);\n    const inflateRaw = await zlib.inflateRaw(deflateRaw);\n    console.log('DeflateRaw match:', inflateRaw.toString() === original);\n\n    // Brotli with promise\n    const brotlied = await zlib.brotliCompress(original);\n    const unbrotlied = await zlib.brotliDecompress(brotlied);\n    console.log('Brotli match:', unbrotlied.toString() === original);\n\n    // Unzip with auto-detection\n    const unzipped = await zlib.unzip(gzipped);\n    console.log('Auto-detect match:', unzipped.toString() === original);\n\n    // With compression level options\n    const compressed1 = await zlib.gzip(original, { level: 1 }); // Fast\n    const compressed9 = await zlib.gzip(original, { level: 9 }); // Best\n    console.log('Fast compression:', compressed1.length, 'bytes');\n    console.log('Best compression:', compressed9.length, 'bytes');\n\n  } catch (err) {\n    console.error('Compression error:', err.message);\n  }\n}\n\ndemonstratePromises();\n```\n\n### Auto-detect Decompression with Unzip\n\n```javascript\nconst zlib = require('react-zlib-js');\n\nconst original = 'Test data for auto-detection';\n\n// Compress with different algorithms\nconst gzipped = zlib.gzipSync(original);\nconst deflated = zlib.deflateSync(original);\n\n// unzip auto-detects the format\nconst fromGzip = zlib.unzipSync(gzipped);\nconst fromDeflate = zlib.unzipSync(deflated);\n\nconsole.log('From Gzip:', fromGzip.toString());\nconsole.log('From Deflate:', fromDeflate.toString());\n```\n\n### CRC32 Checksum Calculation\n\n```javascript\nconst zlib = require('react-zlib-js');\n\n// Simple CRC32\nconst crc = zlib.crc32('hello');\nconsole.log('CRC32 of \"hello\":', crc);\n\n// CRC32 with Buffer\nconst bufferCrc = zlib.crc32(Buffer.from([0x68, 0x65, 0x6c, 0x6c, 0x6f]));\nconsole.log('CRC32 from buffer:', bufferCrc);\n\n// Streaming/chunked CRC32\nfunction calculateStreamingCRC(chunks) {\n  let crc = 0;\n  for (const chunk of chunks) {\n    crc = zlib.crc32(chunk, crc);\n  }\n  return crc;\n}\n\nconst chunks = ['Hello', ', ', 'World', '!'];\nconst streamCrc = calculateStreamingCRC(chunks);\nconst directCrc = zlib.crc32('Hello, World!');\n\nconsole.log('Streaming CRC:', streamCrc);\nconsole.log('Direct CRC:', directCrc);\nconsole.log('Match:', streamCrc === directCrc);\n```\n\n### JSON Compression for API\n\n```javascript\nconst zlib = require('react-zlib-js');\n\n// Compress JSON data\nfunction compressJSON(obj) {\n  const json = JSON.stringify(obj);\n  return zlib.gzipSync(json);\n}\n\n// Decompress JSON data\nfunction decompressJSON(compressed) {\n  const json = zlib.gunzipSync(compressed);\n  return JSON.parse(json.toString());\n}\n\n// Example\nconst data = {\n  users: [\n    { id: 1, name: 'Alice', email: 'alice@example.com' },\n    { id: 2, name: 'Bob', email: 'bob@example.com' }\n  ],\n  metadata: {\n    total: 2,\n    page: 1\n  }\n};\n\nconst compressed = compressJSON(data);\nconst decompressed = decompressJSON(compressed);\n\nconsole.log('Original JSON size:', JSON.stringify(data).length);\nconsole.log('Compressed size:', compressed.length);\nconsole.log('Data preserved:', JSON.stringify(data) === JSON.stringify(decompressed));\n```\n\n## Limitations\n\nThree places where this package cannot match Node, stated plainly so you can\ndecide whether they matter for your use.\n\n### Zstd compression is unavailable\n\n`zstdCompress`, `zstdCompressSync` and `createZstdCompress` exist so that code\ntype-checks and feature-detects the same way, but calling them throws\n`ERR_METHOD_NOT_IMPLEMENTED`.\n\nThere is no pure-JavaScript zstd encoder. Every option is a WebAssembly build,\nwhich needs asynchronous initialization - so it cannot back a `*Sync` method -\nand does not run under Hermes, the React Native engine this package targets.\n\nDecompression is fully supported, and `createZstdDecompress()` is genuinely\nincremental.\n\n```javascript\nzlib.zstdDecompressSync(payload);   // works\nzlib.zstdCompressSync(data);        // throws ERR_METHOD_NOT_IMPLEMENTED\n```\n\n### Brotli compression buffers the whole stream\n\nThe `brotli` package exposes only one-shot entry points, so\n`createBrotliCompress()` accumulates all input and emits its output when the\nstream finishes.\n\nThe output is correct at any size, and interoperates with Node's native\nBrotli in both directions. But memory use is proportional to the input, and a\nmid-stream `flush()` cannot emit partial data. If you are compressing\nsomething very large and streaming matters more than the compression ratio,\ngzip is the better choice here.\n\nBrotli *decompression*, and all gzip and deflate operations, stream normally.\n\n### `zlib.constants` is a small superset\n\nIt carries six names Node does not export: `NONE`, `Z_BINARY`, `Z_TEXT`,\n`Z_UNKNOWN`, `Z_DEFLATED` and `Z_TREES`. All of Node's 170 constants are\npresent with identical values.\n\n## Compression Comparison\n\nTypical compression ratios for text data (2KB Lorem Ipsum):\n\n| Algorithm | Compressed Size | Reduction | Speed |\n|-----------|-----------------|-----------|-------|\n| Gzip | 1052 bytes | 47.9% | Fast |\n| Deflate | 1040 bytes | 48.5% | Fast |\n| DeflateRaw | 1034 bytes | 48.8% | Fast |\n| **Brotli** | **751 bytes** | **62.8%** | Slower |\n\nZstd is absent from this table because this package only decodes it; see\n[Limitations](#limitations).\n\n### When to Use Each Algorithm\n\n| Algorithm | Best For |\n|-----------|----------|\n| **Gzip** | HTTP compression, general purpose, wide compatibility |\n| **Deflate** | ZIP files, PNG images, HTTP (older) |\n| **DeflateRaw** | Custom protocols, embedded systems |\n| **Brotli** | Static content, web assets, when size matters most |\n| **Zstd** | Decoding payloads from a server that already speaks zstd |\n\n## React Native Usage\n\n```javascript\nimport zlib from 'react-zlib-js';\n\n// Compress API request body\nasync function sendCompressedData(data) {\n  const jsonString = JSON.stringify(data);\n  const compressed = zlib.gzipSync(jsonString);\n\n  const response = await fetch('https://api.example.com/data', {\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/json',\n      'Content-Encoding': 'gzip'\n    },\n    body: compressed\n  });\n\n  return response.json();\n}\n\n// Decompress API response\nasync function receiveCompressedData(url) {\n  const response = await fetch(url);\n  const compressed = await response.arrayBuffer();\n  const decompressed = zlib.gunzipSync(Buffer.from(compressed));\n  return JSON.parse(decompressed.toString());\n}\n\n// Compress for local storage\nfunction saveCompressed(key, data) {\n  const compressed = zlib.gzipSync(JSON.stringify(data));\n  const base64 = compressed.toString('base64');\n  AsyncStorage.setItem(key, base64);\n}\n\n// Decompress from local storage\nasync function loadCompressed(key) {\n  const base64 = await AsyncStorage.getItem(key);\n  if (!base64) return null;\n  const compressed = Buffer.from(base64, 'base64');\n  const decompressed = zlib.gunzipSync(compressed);\n  return JSON.parse(decompressed.toString());\n}\n```\n\n## Browser Usage\n\n### With Webpack/Browserify\n\n```javascript\nconst zlib = require('react-zlib-js');\n\n// Works in browser environment\nconst compressed = zlib.deflateSync('Browser data');\nconst decompressed = zlib.inflateSync(compressed);\nconsole.log(decompressed.toString());\n```\n\n### Direct Script Include\n\n```html\n<script src=\"path/to/index.js\"></script>\n<script src=\"path/to/buffer.js\"></script>\n<script>\n  // zlib is available globally\n  const compressed = zlib.gzipSync('Hello from browser');\n  console.log('Compressed size:', compressed.length);\n</script>\n```\n\n## Building from Source\n\n```bash\n# Clone repository\ngit clone https://github.com/anuraghkp1/zlib.git\ncd zlib\n\n# Install dependencies\nnpm install\n\n# Build the browser/React Native bundle\nnpm run build           # index.js\nnpm run build:buffer    # buffer.js\n\n# Regenerate the constant table and the type definitions\nnpm run build:constants # src/constants.js, from the running Node's zlib\nnpm run build:types     # index.d.ts, from src/constants.js\n\n# Run tests against both entry points\nnpm test\nnpm run test:src        # source only\nnpm run test:bundle     # bundle only\n```\n\n### Project Structure\n\n```\nzlib/\n├── src/\n│   ├── index.js          # Package main; re-exports zlib.js\n│   ├── zlib.js           # Public API: classes, factories, convenience methods\n│   ├── zlib-base.js      # Shared Transform: write loop, lifecycle, options\n│   ├── binding.js        # Deflate/inflate binding over pako\n│   ├── brotli-binding.js # Brotli binding over the brotli package\n│   ├── zstd-binding.js   # Zstd decode binding over fzstd\n│   ├── constants.js      # All 176 constants (generated)\n│   ├── errors.js         # Node's ERR_* classes\n│   └── crc32.js          # CRC-32\n├── test/                 # node:test suites, run against both entries\n├── scripts/              # Constant/type generators, test runner\n├── index.js              # Browserified bundle (~1.3MB)\n├── buffer.js             # Buffer implementation (~55KB)\n├── index.d.ts            # TypeScript definitions (generated)\n└── README.md             # This documentation\n```\n\nThe test suite is differential: it diffs the export list, all of Node's\nconstants and every class prototype against the host's real `zlib`, compares\nerror outcomes case by case, and round-trips every codec against Node's\nnative implementation in both directions.\n\n### Dependencies\n\n| Package | Purpose |\n|---------|---------|\n| `pako` | Pure JS deflate/inflate implementation |\n| `brotli` | Pure JS Brotli implementation |\n| `fzstd` | Pure JS Zstd decompressor |\n| `browserify` | Bundle for browser (dev dependency) |\n\n## Migration to v3.x\n\nMost code needs no changes. v3.0.0 is a major version because error handling\nand the package entry point changed.\n\n### Errors now match Node's\n\nValidation errors carry Node's `code`, prototype and message text. If you were\nmatching on the old message strings, match on `err.code` instead:\n\n```javascript\n// Before (v2.x): plain Error, message \"Invalid compression level: 12\"\n// Now: RangeError, code ERR_OUT_OF_RANGE, Node's exact message\ntry {\n  zlib.gzipSync(data, { level: 12 });\n} catch (err) {\n  if (err.code === 'ERR_OUT_OF_RANGE') { /* ... */ }\n}\n```\n\nRuntime stream errors are unchanged: they still carry `err.code` of\n`Z_DATA_ERROR` and friends.\n\n### Node consumers now get real Buffers\n\n`main` resolves to the source rather than the browserify bundle, so\n`Buffer.isBuffer(result)` is now `true` under Node. Browsers and React Native\nstill load the prebuilt bundle through the `browser` and `react-native`\nfields, unchanged.\n\n### Corrected constant values\n\n`BROTLI_ENCODE` and `BROTLI_DECODE` were transposed and are now 9 and 8, as\nNode has them. `zlib.codes` no longer has a stray `\"undefined\"` key, and now\nincludes `Z_MEM_ERROR` and `Z_VERSION_ERROR`.\n\n### Bugs fixed\n\n- Brotli decompression corrupted or threw on payloads over 16 KB.\n- Brotli compression silently returned zero bytes for short or incompressible\n  input.\n- Brotli errors crashed the process instead of reaching your callback or\n  rejecting your promise.\n- `params()` crashed the process; it now retunes the stream as Node's does.\n- `windowBits: 8` is now rejected for compression, matching Node. Use 9.\n\n### New in v3.0.0\n\n- Zstd decompression, and all 72 `ZSTD_*` constants\n- `maxOutputLength`, `info: true`, `bytesWritten` and `bytesRead`\n- `ArrayBuffer` accepted as input\n- 98 previously missing constants\n\n## Migration from v1.x\n\n### New in v2.0.0\n\n#### 1. Brotli Compression Support\n\n```javascript\n// New methods available\nzlib.brotliCompress(data, callback);\nzlib.brotliCompressSync(data);\nzlib.brotliDecompress(data, callback);\nzlib.brotliDecompressSync(data);\nzlib.createBrotliCompress();\nzlib.createBrotliDecompress();\n\n// New classes\nnew zlib.BrotliCompress(options);\nnew zlib.BrotliDecompress(options);\n```\n\n#### 2. CRC32 Function\n\n```javascript\n// Calculate checksums\nconst crc = zlib.crc32('data');\nconst chainedCrc = zlib.crc32('more data', crc);\n```\n\n#### 3. Brotli Constants\n\n```javascript\n// All Brotli constants now available\nzlib.BROTLI_OPERATION_PROCESS\nzlib.BROTLI_OPERATION_FLUSH\nzlib.BROTLI_OPERATION_FINISH\nzlib.BROTLI_PARAM_MODE\nzlib.BROTLI_PARAM_QUALITY\nzlib.BROTLI_MODE_TEXT\nzlib.BROTLI_MODE_GENERIC\nzlib.BROTLI_MODE_FONT\n// ... and more\n```\n\n#### 4. Constants Object\n\n```javascript\n// Access all constants via zlib.constants\nzlib.constants.Z_BEST_COMPRESSION\nzlib.constants.BROTLI_MAX_QUALITY\n```\n\n### Breaking Changes in v2.0.0\n\n**None.** Version 2.0.0 was fully backward compatible with v1.x.\n\nVersion 3.0.0 does introduce breaking changes - see\n[Migration to v3.x](#migration-to-v3x).\n\n## Troubleshooting\n\n### `ERR_INVALID_ARG_TYPE`\n\n**Problem:** Input is not a type the compression methods accept.\n\n**Solution:** Pass a string, `Buffer`, `TypedArray`, `DataView` or\n`ArrayBuffer`:\n\n```javascript\n// Wrong - throws ERR_INVALID_ARG_TYPE\nzlib.gzipSync(123);\nzlib.gzipSync({ data: 'test' });\n\n// Correct\nzlib.gzipSync('123');\nzlib.gzipSync(Buffer.from('123'));\nzlib.gzipSync(new Uint8Array([1, 2, 3]));\nzlib.gzipSync(JSON.stringify({ data: 'test' }));\n```\n\nIn 2.x this was a plain `Error` reading \"Not a string or buffer\". It is now a\n`TypeError` with Node's code and message; see\n[Error Handling](#error-handling).\n\n### `ERR_BUFFER_TOO_LARGE`\n\n**Problem:** Output grew past the `maxOutputLength` you set.\n\n**Solution:** Raise the cap, or treat it as the guard it is. When decompressing\nuntrusted input, catching this is the point:\n\n```javascript\ntry {\n  zlib.gunzipSync(untrusted, { maxOutputLength: 10 * 1024 * 1024 });\n} catch (err) {\n  if (err.code === 'ERR_BUFFER_TOO_LARGE') {\n    // Refuse the payload rather than exhausting memory\n  }\n}\n```\n\n### Memory Issues with Large Data\n\n**Problem:** Out of memory when compressing large data.\n\n**Solution:** Use streaming for large data:\n\n```javascript\n// Instead of sync methods for large data\n// const compressed = zlib.gzipSync(hugeData); // May run out of memory\n\n// Use streaming\nconst gzip = zlib.createGzip();\nconst chunks = [];\n\ngzip.on('data', chunk => chunks.push(chunk));\ngzip.on('end', () => {\n  const compressed = Buffer.concat(chunks);\n  // Process compressed data\n});\n\n// Process in chunks\nconst chunkSize = 64 * 1024; // 64KB chunks\nfor (let i = 0; i < hugeData.length; i += chunkSize) {\n  gzip.write(hugeData.slice(i, i + chunkSize));\n}\ngzip.end();\n```\n\n### Decompression Errors\n\n**Problem:** \"invalid header\" or \"data error\" when decompressing.\n\n**Solution:** Ensure you're using the correct decompression method:\n\n```javascript\n// Wrong: Using gunzip for deflate data\nconst deflated = zlib.deflateSync('test');\n// zlib.gunzipSync(deflated); // Error!\n\n// Correct: Match compression and decompression methods\nconst deflated = zlib.deflateSync('test');\nconst result = zlib.inflateSync(deflated); // Works!\n\n// Or use unzip for auto-detection\nconst result = zlib.unzipSync(deflated); // Also works!\n```\n\n### Performance Tips\n\n1. **Use Brotli for static content** - Better compression, slower\n2. **Use Gzip for dynamic content** - Good compression, fast\n3. **Use sync methods sparingly** - They block the event loop\n4. **Set appropriate compression level** - Balance size vs speed\n5. **Create a new stream per operation** - a stream cannot be written to\n   again once it has ended\n\n## License\n\nMIT License\n\nCopyright (c) 2020-2025 Anuragh K.P\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 all\ncopies 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 THE\nSOFTWARE.\n\n## Author\n\n**Anuragh K.P**\n\n## Contributing\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## Links\n\n- [npm Package](https://www.npmjs.com/package/react-zlib-js)\n- [GitHub Repository](https://github.com/anuraghkp1/zlib)\n- [Issue Tracker](https://github.com/anuraghkp1/zlib/issues)\n- [Node.js zlib Documentation](https://nodejs.org/api/zlib.html)\n\n---\n\n**Made with JavaScript for JavaScript**\n","readmeFilename":"README.md"}