# readzip

> read zip archive in simplest possible way

Latest version **3.0.0** (published 2026-02-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install readzip
pnpm add readzip
yarn add readzip
bun add readzip
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2026-02-12 |
| First published | 2021-02-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=22 |
| Dependencies | 4 |
| Unpacked size | 11.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Maintainers | coderaiser |
| Keywords | zip, archive, read, generators |

## Links

- npm: https://www.npmjs.com/package/readzip
- Repository: https://github.com/coderaiser/readzip
- Homepage: http://github.com/coderaiser/readzip
- Issues: https://github.com/coderaiser/readzip/issues
- npm.io page: https://npm.io/package/readzip

## Dependencies (4)

- [once](https://npm.io/package/once.md) ^1.4.0
- [yauzl](https://npm.io/package/yauzl.md) ^3.2.0
- [wraptile](https://npm.io/package/wraptile.md) ^3.0.0
- [try-to-catch](https://npm.io/package/try-to-catch.md) ^4.0.5

## 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

- 3.0.0 (latest) — 2026-02-12
- 2.0.0 — 2023-08-10
- 1.0.1 — 2021-02-18
- 1.0.0 — 2021-02-11

## README

# Readzip [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL]

[NPMIMGURL]: https://img.shields.io/npm/v/readzip.svg?style=flat
[BuildStatusURL]: https://github.com/coderaiser/readzip/actions
[BuildStatusIMGURL]: https://github.com/coderaiser/readzip/workflows/CI/badge.svg
[LicenseIMGURL]: https://img.shields.io/badge/license-MIT-317BF9.svg?style=flat
[NPMURL]: https://npmjs.org/package/readzip "npm"
[BuildStatusURL]: https://travis-ci.org/coderaiser/readzip "Build Status"
[LicenseURL]: https://tldrlegal.com/license/mit-license "MIT License"
[CoverageURL]: https://coveralls.io/github/coderaiser/readzip?branch=master
[CoverageIMGURL]: https://coveralls.io/repos/coderaiser/readzip/badge.svg?branch=master&service=github

Read zip archive in simplest possible way.

## Install

```
npm i readzip
```

## API

`path` contains information about current file, it has next methods:

- `isFile([name])` check if current `entitiy` is file, also compares path, when `name` passed;
- `isDirectory([name])` checks if current `entity` is directory, also compares path, when `name` passed;
- `openReadStream` - promise, returns file `stream`;
- `stop` - close archive file and break from traversing loop;

Also `path` has fields that can be used to get some information

- `name`
- `size`
- `date`
- `mode`
- `directory`
- `type`
- `owner`

```js
import {readzip} from 'readzip';

const archivePath = './hello.zip';

for await (const path of readzip(archivePath)) {
    const {name} = path;
    
    if (path.isFile()) {
        console.log('file:', name);
    }
    
    if (path.isDirectory()) {
        console.log('directory:', name);
    }
}
```

Similar to info returned by [readify](https://github.com/coderaiser/readify).

## Related

- [redzip](https://github.com/coderaiser/redzip "redzip") - work with zip archives as it is regular files and directories
- [readify](https://github.com/coderaiser/readify "readify") - read directory content with file attributes: size, date, owner, mode
- [readbox](https://github.com/coderaiser/readbox "readbox") - read file or directory from `dropbox`

## License

MIT

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