# zip-stream

> a streaming zip archive generator.

Latest version **7.0.5** (published 2026-05-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install zip-stream
pnpm add zip-stream
yarn add zip-stream
bun add zip-stream
```

## Health

**Score 68/100 (B)** — status: active.

Positive: has types package; esm support; no vulnerabilities; has provenance; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 7.0.5 |
| Published | 2026-05-08 |
| First published | 2014-01-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/zip-stream) |
| Module format | ESM |
| Node | >=18 |
| Dependencies | 3 |
| Unpacked size | 9.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 168 |
| Author | Chris Talkington |
| Maintainers | ctalkington |
| Keywords | archive, stream, zip-stream, zip |

## Links

- npm: https://www.npmjs.com/package/zip-stream
- Repository: https://github.com/archiverjs/node-zip-stream
- Issues: https://github.com/archiverjs/node-zip-stream/issues
- npm.io page: https://npm.io/package/zip-stream

## Dependencies (3)

- [normalize-path](https://npm.io/package/normalize-path.md) ^3.0.0
- [readable-stream](https://npm.io/package/readable-stream.md) ^4.0.0
- [compress-commons](https://npm.io/package/compress-commons.md) ^7.0.0

## Alternatives

- [lodash.startswith](https://npm.io/package/lodash.startswith.md) — 769.7K weekly downloads
- [@tarojs/service](https://npm.io/package/@tarojs/service.md) — 33.9K weekly downloads
- [io.extendreality.tilia.indicators.spatialtargets.unity](https://npm.io/package/io.extendreality.tilia.indicators.spatialtargets.unity.md) — 131 weekly downloads
- [@rtarojs/taro](https://npm.io/package/@rtarojs/taro.md) — 90 weekly downloads
- [node-branch-io](https://npm.io/package/node-branch-io.md) — 50 weekly downloads

## Recent versions

- 7.0.5 (latest) — 2026-05-08
- 7.0.4 — 2026-05-08
- 7.0.2 — 2024-10-16
- 7.0.1 — 2024-10-16
- 7.0.0 — 2024-10-16
- 6.0.1 — 2024-03-10
- 6.0.0 — 2024-02-27
- 5.0.2 — 2024-02-27
- 5.0.1 — 2023-09-03
- 5.0.0 — 2023-09-03
- 4.1.1 — 2023-09-02
- 4.1.0 — 2021-03-03
- 4.0.4 — 2020-11-19
- 4.0.3 — 2020-11-19
- 4.0.2 — 2020-07-21
- … 40 more at https://npm.io/package/zip-stream/versions

## README

# ZipStream

zip-stream is a streaming zip archive generator based on the `ZipArchiveOutputStream` prototype found in the [compress-commons](https://www.npmjs.org/package/compress-commons) project.

It was originally created to be a successor to [zipstream](https://npmjs.org/package/zipstream).

Visit the [API documentation](http://archiverjs.com/zip-stream) for a list of all methods available.

### Install

```bash
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.

### Usage

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](https://npmjs.org/package/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](https://npmjs.org/package/archiver) which uses this module internally.

```js
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();
  });
});
```

## Credits

Concept inspired by Antoine van Wel's [zipstream](https://npmjs.org/package/zipstream) module, which is no longer being updated.

---
_Source: https://npm.io/package/zip-stream · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
