adm-zip
adm-zip is a pure JavaScript library for reading, creating, and extracting ZIP archives in Node.js without native dependencies. The library provides a simple, s…
Installation
npm install adm-zip
yarn add adm-zip
pnpm add adm-zip
Import
import AdmZip from 'adm-zip';
Quick Example
import AdmZip from 'adm-zip';
// Read existing ZIP
const zip = new AdmZip('archive.zip');
const entries = zip.getEntries();
entries.forEach((e) => console.log(e.entryName));
zip.extractAllTo('output/', true);
// Create new ZIP
const newZip = new AdmZip();
newZip.addLocalFile('README.md');
newZip.addLocalFolder('src/', 'source/');
newZip.writeZip('new-archive.zip');About adm-zip
adm-zip is a pure JavaScript library for reading, creating, and extracting ZIP archives in Node.js without native dependencies. The library provides a simple, synchronous API for working with ZIP files — read entries, extract files to disk or memory, add files and directories, update existing archives, and create new ZIP files from scratch. adm-zip reads the entire ZIP file into memory for manipulation, which makes it simple to use but less suitable for very large archives where Archiver's streaming approach is preferred. The API provides methods like getEntries() for listing archive contents, readAsText() and readFile() for reading specific entries, extractAllTo() for extracting the entire archive, addLocalFile() for adding files, and writeZip() for saving changes. Each entry includes metadata like filename, size, compressed size, comment, and modification date. adm-zip supports ZIP64 for files larger than 4GB, password-protected archives, and Unicode filenames. The library is particularly useful for quick ZIP operations in scripts, test fixtures, and applications that need to inspect or modify ZIP contents without streaming complexity. adm-zip works well for moderate-sized archives where the convenience of in-memory manipulation outweighs memory considerations.
Quick Facts
| Package | adm-zip |
| Category | File System |
| Weekly Downloads | 3M+ |
| License | MIT |
| Install | npm install adm-zip |
Related Packages
Archiver is a streaming interface for generating archive files (ZIP, TAR, TAR.GZ) in Node.js. The li…
tar is the official npm package for reading, creating, and extracting tar archives in Node.js, suppo…
fs-extra is a drop-in replacement for Node.js's built-in fs module that adds additional file system …
Browse npm Packages by Category
Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.