June 2014
Intermediate to advanced
696 pages
38h 52m
English
The Zlib module provides several helper functions that make it easy to compress/decompress data buffers. They all use the same basic format of function(buffer, callback), where function is the compression/decompression method, buffer is the buffer to be compressed/decompressed, and callback is the callback function that is executed after the compression/decompression occurs.
The simplest way to illustrate buffer compression/decompression is to show you some examples. The code in Listing 5.11 provides several compression/decompression examples and outputs the size results of each as shown in Figure 5.11.
Listing 5.11 zlib_buffers.js: Compressing/decompressing buffers using the Zlib module
Read now
Unlock full access