The Wayback Machine - https://web.archive.org/web/20240118171509/https://www.geeksforgeeks.org/node-js-zlib-complete-reference/
Open In App
Related Articles

Node.js Zlib Complete Reference

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report

The zlib module provides compression functionality implemented using Gzip, Deflate/Inflate, and Brotli.

The Complete Reference of Zlib are listed below:

Methods

Description

zlib.constants It is used to yields an object listing Zlib-related constants.
zlib.createBrotliCompress() It is used to create BrotliCompress object.
zlib.createBrotliDecompress() It is used to create a new BrotliDecompress object.
zlib.createUnzip() It is used to create a new Unzip object.
zlib.createDeflateRaw() It is used to create a new DeflateRaw object.
zlib.createGunzip() It is used to create a new Gunzip object.
zlib.createInflateRaw() It is used to create a new InflateRaw object.
zlib.createDeflate() It is used to create a new Deflate object.
zlib.createInflate() It is used to create a new Inflate object.
zlib.gzip() It is used to compress a chunk of data.

Class: zlib.ZlibBase

Methods

Description

zlib.bytesWritten It is used to specify the number of bytes written to the engine before the bytes are processed.
zlib.close() It is used to close the underlying handle.
zlib.flush() It can compel zlib to return as much output as achievable at present.

Convenience Methods

Methods

Description

zlib.brotliCompress() It is used to compresses a chunk of data.
zlib.brotliCompressSync() It is used to compress a chunk of data with BrotliCompress.
zlib.brotliDecompress() It is used to decompresses a chunk of data with BrotliCompress.
zlib.brotliDecompressSync() is used to decompress a chunk of data with BrotliDecompress.
zlib.deflate() It is used to compress a chunk of data.
zlib.deflateSync() It is used to compress a chunk of data with Deflate.
zlib.deflateRaw() It is used to compress a chunk of data.
zlib.deflateRawSync() It is used to compress a chunk of data with DeflateRaw.
zlib.gunzip() It is used to decompress a chunk of data.
zlib.gunzipSync() It is used to decompress a chunk of data with Gunzip.
zlib.createGzip() It is used to create a new Gzip object.
zlib.gzipSync() It is used to compress a chunk of data with Gzip.
zlib.inflate() It is used to decompress a chunk of data.
zlib.inflateSync() It is used to decompress a chunk of data with Inflate.
zlib.inflateRaw() It is used to decompress a chunk of data.
zlib.inflateRawSync() It is used to decompress a chunk of data with InflateRaw.
zlib.unzip() It is used to decompress a chunk of data.
zlib.unzipSync() It is used to decompress a chunk of data with Unzip.
Learn to code easily with our course Coding for Everyone. This course is accessible and designed for everyone, even if you're new to coding. Start today and join millions on a journey to improve your skills!

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Commit to GfG's Three-90 Challenge! Purchase a course, complete 90% in 90 days, and save 90% cost click here to explore.
Last Updated : 28 Jul, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads
Complete Tutorials