# adm-zip

> Javascript implementation of zip for nodejs with support for electron original-fs. Allows user to create or extract zip files both in memory or to/from disk

Latest version **0.6.1** (published 2026-09-11) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.6.1 |
| Published | 2026-09-11 |
| First published | 2012-02-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=14.0 |
| Dependencies | 0 |
| Unpacked size | 147 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2185 |
| Author | Nasca Iacob |
| Maintainers | cthackers |
| Keywords | zip, methods, archive, unzip |

## Links

- npm: https://www.npmjs.com/package/adm-zip
- Repository: https://github.com/cthackers/adm-zip
- Issues: https://github.com/cthackers/adm-zip/issues
- npm.io page: https://npm.io/package/adm-zip

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

- 0.6.1 (latest) — 2026-09-11
- 0.6.0 — 2026-07-10
- 0.5.18 — 2026-06-29
- 0.5.17 — 2026-04-01
- 0.5.16 — 2024-08-30
- 0.5.15 — 2024-08-05
- 0.5.14 — 2024-06-04
- 0.5.13 — 2024-06-01
- 0.5.12 — 2024-03-14
- 0.5.11 — 2024-03-13
- 0.5.10 — 2022-12-20
- 0.5.9 — 2021-10-07
- 0.5.8 — 2021-10-07
- 0.5.7 — 2021-10-01
- 0.5.6 — 2021-09-12
- … 29 more at https://npm.io/package/adm-zip/versions

## README

# ADM-ZIP for NodeJS

ADM-ZIP is a pure JavaScript implementation for zip data compression for [NodeJS](https://nodejs.org/).

<a href="https://github.com/cthackers/adm-zip/actions/workflows/ci.yml">
  <img src="https://github.com/cthackers/adm-zip/actions/workflows/ci.yml/badge.svg" alt="Build Status">
</a>

# Installation

With [npm](https://www.npmjs.com/) do:

    $ npm install adm-zip

**Electron** file system support described below.

## What is it good for?

The library allows you to:

-   decompress zip files directly to disk or in memory buffers
-   compress files and store them to disk in .zip format or in compressed buffers
-   update content of/add new/delete files from an existing .zip

# Dependencies

There are no other nodeJS libraries that ADM-ZIP is dependent of

# Examples

## Basic usage

```javascript
var AdmZip = require("adm-zip");

// reading archives
var zip = new AdmZip("./my_file.zip");
var password = "1234567890";
var zipEntries = zip.getEntries(); // an array of ZipEntry records - add password parameter if entries are password protected

zipEntries.forEach(function (zipEntry) {
    console.log(zipEntry.toString()); // outputs zip entries information
    if (zipEntry.entryName == "my_file.txt") {
        console.log(zipEntry.getData().toString("utf8"));
    }
});
// outputs the content of some_folder/my_file.txt
console.log(zip.readAsText("some_folder/my_file.txt"));
// extracts the specified file to the specified location
zip.extractEntryTo(/*entry name*/ "some_folder/my_file.txt", /*target path*/ "/home/me/tempfolder", /*maintainEntryPath*/ false, /*overwrite*/ true);
// extracts everything
zip.extractAllTo(/*target path*/ "/home/me/zipcontent/", /*overwrite*/ true);

// creating archives
var zip = new AdmZip();

// add file directly
var content = "inner content of the file";
zip.addFile("test.txt", Buffer.from(content, "utf8"), "entry comment goes here");
// add local file
zip.addLocalFile("/home/me/some_picture.png");
// get everything as a buffer
var willSendthis = zip.toBuffer();
// or write everything to disk
zip.writeZip(/*target file name*/ "/home/me/files.zip");

// ... more examples in the wiki
```

For more detailed information please check out the [wiki](https://github.com/cthackers/adm-zip/wiki).

## Electron original-fs

ADM-ZIP has supported electron **original-fs** for years without any user interractions but it causes problem with bundlers like rollup etc. For continuing support **original-fs** or any other custom file system module. There is possible specify your module by **fs** option in ADM-ZIP constructor.

Example:

```javascript
const AdmZip = require("adm-zip");
const OriginalFs = require("original-fs");

// reading archives
const zip = new AdmZip("./my_file.zip", { fs: OriginalFs });
.
.
.
```
## Security

Please report security vulnerabilities privately. See [SECURITY.md](./SECURITY.md).

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