0.5.12 • Published 1 month ago

adm-zip v0.5.12

Weekly downloads
2,944,887
License
MIT
Repository
github
Last release
1 month ago

ADM-ZIP for NodeJS with added support for electron original-fs

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

Installation

With npm do:

$ npm install adm-zip

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.

Build Status

webdriver-managerzk-cli@build-tools-for-vmware-aria/codify@microsoft/teamsfx-cli@microsoft/teamsfx-core@pnp/cli-microsoft365@dxatscale/sfpowerscripts@falloutstudios/rmm@serverless/components@zjinh/electron-builder-encryptoradcharity-remarkable-apiautomation-scripts@architect-io/cli@serverless-devs/s-beta@serverless-dev/s-testnextless@pil0t/gatsby-theme-novelacodeserver@thirdwave-network/thirdwave-gatsby-themeshocky@darkhm/essence-constructor-scriptsxploreofficeewa-ts-cli@maxtan/wonders-tohtml@kyrelldixon/gatsby-theme-novelakurigashvili-testpackagekurigashvili-testpackage-xmagnoabsass-sdfddabc-jdjdjjdnextf@tizentv/witstestdocx-parseqkube-cliwits-beta-testtenantparser@sirius-black/taro-clithinkclear-common-utilreacttsx-scripts@tizentv/testhpe-sfdx-pluginswooooosikwooooosik11wooooosik12wooooosik13wooooosik5wooooosik7wooooosik8@tizentv/testmodule@coder/code-serverganister-installerthutilityui5-createwebpack-builder-zipfoldercv3-clidev-agnitio-cliftscsourcify-validationpluxury-cli@merthin/ark@merthin/ced-clicustom-gatsby-theme-novelakakuri-ask-clikakuri2-ask-cli@audio-project-manager/apm-clitestioportblipabrown-sample-pluginwinrader@studiorack/studiorack-clids-linear-service@plurid/developer-clioakmont-bakery-posfim1solrservenvato-climaestro-vsc-extension-pluginshopseg-bee-climidhub-contractsasm-auto-deploydendro-cli@pega/custom-component@maximekjaer/tfjs-npylb-agora-classroom-edu-sdknode-kotlinraykgustin-excel2jsoncamscripter-rabsberry@equippedcoding/appfactorysxyj_taro_cli@skoda-dms/basic-lib@interaktiv/mibuildernodes-vscode-utilsnodejs-vscode-utilsnode-ts-file@totvslabs/carolmarjory-factory-clibds_maneger_api@massbit/indexer-managerbds-manegemcplug.js
0.5.11

1 month ago

0.5.12

1 month ago

0.5.10

1 year ago

0.5.8

3 years ago

0.5.7

3 years ago

0.5.9

3 years ago

0.5.6

3 years ago

0.5.5

3 years ago

0.5.4

3 years ago

0.5.3

3 years ago

0.5.2

3 years ago

0.5.1

3 years ago

0.5.0

3 years ago

0.4.16

4 years ago

0.4.14

4 years ago

0.4.13

5 years ago

0.4.11

6 years ago

0.4.10

6 years ago

0.4.9

6 years ago

0.4.8

6 years ago

0.4.7

9 years ago

0.4.6

9 years ago

0.4.5

9 years ago

0.4.4

10 years ago

0.4.3

11 years ago

0.2.1

11 years ago

0.2.0

11 years ago

0.1.9

11 years ago

0.1.8

12 years ago

0.1.7

12 years ago

0.1.6

12 years ago

0.1.5

12 years ago

0.1.4

12 years ago

0.1.3

12 years ago

0.1.2

12 years ago

0.1.1

12 years ago