Home > Article > Web Front-end > Nodejs gzip decompression base64 method
zlib comes with nodejs. You can directly use
the following code to compress and decompress base64 gzip
Reference documentation https://nodejs.org/api/zlib.html
const zlib = require('zlib');var buffer = new Buffer('H4sIAAAAAAAAAIuOBQApu0wNAgAAAA==', 'base64'); zlib.unzip(buffer, function(err, buffer) { if (!err) { console.log(buffer.toString()); } });
The above is the detailed content of Nodejs gzip decompression base64 method. For more information, please follow other related articles on the PHP Chinese website!