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
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 archivesvar 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 protectedzipEntries.forEach(function (zipEntry) { console.log(zipEntry.toString()); // outputs zip entries information if (zipEntry.entryName == "my_file.txt") { console.log(zipEntry.getData().toString("utf8")); }});
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 archivesconst zip = new AdmZip("./my_file.zip", { fs: OriginalFs });...
Security
Please report security vulnerabilities privately. See SECURITY.md.