MCPcopy Index your code
hub / github.com/cthackers/adm-zip

github.com/cthackers/adm-zip @v0.5.18

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.5.18 ↗ · + Follow
100 symbols 163 edges 29 files 2 documented · 2% 106 cross-repo links updated 8d agov0.5.18 · 2026-06-29★ 2,171138 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

ADM-ZIP for NodeJS

ADM-ZIP is a pure JavaScript implementation for zip data compression for NodeJS.

Build Status

Installation

With npm 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

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.

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:

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.

Core symbols most depended-on inside this repo

getEntry
called by 13
adm-zip.js
decrypt
called by 10
methods/zipcrypto.js
readEntries
called by 9
zipFile.js
next
called by 9
adm-zip.js
uint32
called by 8
headers/entryHeader.js
get_Bool
called by 7
adm-zip.js
fixPath
called by 6
adm-zip.js
bytes
called by 6
headers/entryHeader.js

Shape

Function 100

Languages

TypeScript100%

Modules by API surface

headers/entryHeader.js29 symbols
zipEntry.js17 symbols
adm-zip.js13 symbols
methods/zipcrypto.js9 symbols
zipFile.js7 symbols
util/fattr.js7 symbols
headers/mainHeader.js7 symbols
test/methods/methods.test.js5 symbols
util/utils.js4 symbols
util/errors.js1 symbols
test/mocha.js1 symbols

For agents

$ claude mcp add adm-zip \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact