Compression using zlib
Medium
0.0% Acceptance
In this lab, you will learn how to compress a string using the zlib
library, which is a built-in Node.js module. Many web applications require compressing and decompressing data. zlib
is a powerful and frequently used compression library in Node.js for this purpose.
In this lab, you will be provided with a string that needs to be compressed using zlib's gzip()
method. You need to create a function called compressString
that takes a string as input, compresses it using the gzip
method, and returns the compressed data as a promise.
Challenges
- Import the zlib module
- Create a compressString function
- Use the gzip method inside compressString
- Return compressed data as a promise
- Export the compressString function