The easiest way to decode a GZip response with Node.js is to use a deprecated request
npm module:
var request = require('request');
const options = {
method: 'GET',
uri: 'https://google.com',
gzip: true
};
request(options, function (error, response, body) {
// body is the decompressed response body
console.log('response body: ' + body);
});
References: