Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
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,282,923 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
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.