Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
unzip-response
Advanced tools
The unzip-response npm package is used to decompress HTTP responses that have been compressed using gzip, deflate, or Brotli. It is particularly useful when working with HTTP clients that do not automatically handle decompression of response bodies.
Decompress HTTP Response
This feature allows you to decompress an HTTP response that has been compressed using gzip, deflate, or Brotli. The code sample demonstrates how to use the unzip-response package to handle a compressed HTTP response and log the decompressed data to the console.
const http = require('http');
const unzipResponse = require('unzip-response');
http.get('http://example.com', response => {
response = unzipResponse(response);
response.on('data', chunk => {
console.log(chunk.toString());
});
});
node-fetch is a lightweight module that brings `window.fetch` to Node.js. It automatically handles decompression of response bodies, making it a more comprehensive solution for HTTP requests compared to unzip-response, which focuses solely on decompression.
axios is a promise-based HTTP client for the browser and Node.js. It supports automatic decompression of response bodies and provides a rich set of features for making HTTP requests, including interceptors, request cancellation, and more. It offers a more feature-rich alternative to unzip-response.
request is a simplified HTTP client for Node.js with support for automatic decompression of response bodies. Although it has been deprecated, it remains a popular choice for handling HTTP requests and responses, offering more functionality than unzip-response.
Unzip a HTTP response if needed
Unzips the response from http.request
if it's gzipped/deflated, otherwise just passes it through.
$ npm install --save unzip-response
const http = require('http');
const unzipResponse = require('unzip-response');
http.get('http://sindresorhus.com', res => {
res = unzipResponse(res);
});
MIT © Sindre Sorhus
FAQs
Unzip a HTTP response if needed
The npm package unzip-response receives a total of 1,287,569 weekly downloads. As such, unzip-response popularity was classified as popular.
We found that unzip-response demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.