InterviewSolution
Saved Bookmarks
| 1. |
Why Zlib is used in Node.js? |
|
Answer» The Zlib module provides a way to zip and unzip files. Zlib is a Cross-stage data compression library. It was composed by Jean-loupGailly and Mark Adler. In Node js, you can Zlib for Threadpool, HTTP solicitations, and reactions pressure and Memory Usage Tuning. So as to utilize zlib in node js, you have to introduce HUB zlib bundle. After ESTABLISHMENT, below is the test code to utilize Zlib. var Buffer = require('buffer').Buffer; var zlib = require('zlib'); var input = NEW Buffer('lorem ipsum dolor sit amet'); var compressed = zlib.DEFLATE(input); var output = zlib.inflate(compressed);Following are a few important Zlib properties and Methods:- MethodDescription
|
|