
Research
/Security News
OpenAPI React Query Codegen Compromised in Mini Shai-Hulud npm Supply Chain Attack
Ten malicious OpenAPI React Query Codegen versions were published to npm in the Mini Shai-Hulud attack, all with valid provenance.
zip-stream
Advanced tools
zip-stream is a streaming zip archive generator based on the ZipArchiveOutputStream prototype found in the compress-commons project.
It was originally created to be a successor to zipstream.
Visit the API documentation for a list of all methods available.
npm install zip-stream --save
You can also use npm install https://github.com/archiverjs/node-zip-stream/archive/master.tar.gz to test upcoming versions.
This module is meant to be wrapped internally by other modules and therefore lacks any queue management. This means you have to wait until the previous entry has been fully consumed to add another. Nested callbacks should be used to add multiple entries. There are modules like async that ease the so called "callback hell".
If you want a module that handles entry queueing and much more, you should check out archiver which uses this module internally.
import { ZipStream } from "zip-stream";
const archive = new ZipStream(); // OR new ZipStream(options)
archive.on("error", function (err) {
throw err;
});
// pipe archive where you want it (ie fs, http, etc)
// listen to the destination's end, close, or finish event
archive.entry("string contents", { name: "string.txt" }, function (err, entry) {
if (err) throw err;
archive.entry(null, { name: "directory/" }, function (err, entry) {
if (err) throw err;
archive.finish();
});
});
Concept inspired by Antoine van Wel's zipstream module, which is no longer being updated.
Archiver is a high-level streaming interface for creating archives. It supports multiple archive formats, including ZIP and TAR. It offers more customization options and archive formats compared to zip-stream, which is focused solely on ZIP files.
JSZip is a library for creating, reading, and editing .zip files with JavaScript, with a focus on client-side use. It differs from zip-stream as it is not stream-based and is designed to work with the entire content in memory, which can be less efficient for large files.
Yazl is a minimalistic zip library for Node.js. It is similar to zip-stream in that it focuses on ZIP file creation, but it has a simpler API and fewer features. It may be more suitable for straightforward ZIP file creation without the need for streaming capabilities.
FAQs
a streaming zip archive generator.
The npm package zip-stream receives a total of 27,543,300 weekly downloads. As such, zip-stream popularity was classified as popular.
We found that zip-stream demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Research
/Security News
Ten malicious OpenAPI React Query Codegen versions were published to npm in the Mini Shai-Hulud attack, all with valid provenance.

Security News
Socket joins more than 100 technology, cybersecurity, and financial organizations calling for a global surge in cyber defense.

Product
Enterprise security teams can now detect malware, credential theft, suspicious network activity, and risky updates across Microsoft Edge extensions.