{"id":13527348,"url":"https://github.com/cthackers/adm-zip","last_synced_at":"2025-05-13T16:05:30.085Z","repository":{"id":2537871,"uuid":"3515094","full_name":"cthackers/adm-zip","owner":"cthackers","description":"A Javascript implementation of zip for nodejs. Allows user to create or extract zip files both in memory or to/from disk","archived":false,"fork":false,"pushed_at":"2025-02-19T12:22:18.000Z","size":1122,"stargazers_count":2100,"open_issues_count":145,"forks_count":374,"subscribers_count":39,"default_branch":"master","last_synced_at":"2025-04-29T16:47:24.794Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cthackers.png","metadata":{"files":{"readme":"README.md","changelog":"history.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2012-02-22T14:06:15.000Z","updated_at":"2025-04-29T03:59:46.000Z","dependencies_parsed_at":"2024-03-13T14:59:39.148Z","dependency_job_id":"63f5b400-40c6-4ef2-bd86-5dd0bbf5d37f","html_url":"https://github.com/cthackers/adm-zip","commit_stats":{"total_commits":315,"total_committers":102,"mean_commits":3.088235294117647,"dds":0.7777777777777778,"last_synced_commit":"1cd32f7e0ad3c540142a76609bb538a5cda2292f"},"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cthackers%2Fadm-zip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cthackers%2Fadm-zip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cthackers%2Fadm-zip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cthackers%2Fadm-zip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cthackers","download_url":"https://codeload.github.com/cthackers/adm-zip/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251743227,"owners_count":21636586,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T06:01:46.237Z","updated_at":"2025-05-05T22:48:02.865Z","avatar_url":"https://github.com/cthackers.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Repository"],"sub_categories":["File Compression / Decompression"],"readme":"# ADM-ZIP for NodeJS\n\nADM-ZIP is a pure JavaScript implementation for zip data compression for [NodeJS](https://nodejs.org/).\n\n\u003ca href=\"https://github.com/cthackers/adm-zip/actions/workflows/ci.yml\"\u003e\n  \u003cimg src=\"https://github.com/cthackers/adm-zip/actions/workflows/ci.yml/badge.svg\" alt=\"Build Status\"\u003e\n\u003c/a\u003e\n\n# Installation\n\nWith [npm](https://www.npmjs.com/) do:\n\n    $ npm install adm-zip\n\n**Electron** file system support described below.\n\n## What is it good for?\n\nThe library allows you to:\n\n-   decompress zip files directly to disk or in memory buffers\n-   compress files and store them to disk in .zip format or in compressed buffers\n-   update content of/add new/delete files from an existing .zip\n\n# Dependencies\n\nThere are no other nodeJS libraries that ADM-ZIP is dependent of\n\n# Examples\n\n## Basic usage\n\n```javascript\nvar AdmZip = require(\"adm-zip\");\n\n// reading archives\nvar zip = new AdmZip(\"./my_file.zip\");\nvar password = \"1234567890\";\nvar zipEntries = zip.getEntries(); // an array of ZipEntry records - add password parameter if entries are password protected\n\nzipEntries.forEach(function (zipEntry) {\n    console.log(zipEntry.toString()); // outputs zip entries information\n    if (zipEntry.entryName == \"my_file.txt\") {\n        console.log(zipEntry.getData().toString(\"utf8\"));\n    }\n});\n// outputs the content of some_folder/my_file.txt\nconsole.log(zip.readAsText(\"some_folder/my_file.txt\"));\n// extracts the specified file to the specified location\nzip.extractEntryTo(/*entry name*/ \"some_folder/my_file.txt\", /*target path*/ \"/home/me/tempfolder\", /*maintainEntryPath*/ false, /*overwrite*/ true);\n// extracts everything\nzip.extractAllTo(/*target path*/ \"/home/me/zipcontent/\", /*overwrite*/ true);\n\n// creating archives\nvar zip = new AdmZip();\n\n// add file directly\nvar content = \"inner content of the file\";\nzip.addFile(\"test.txt\", Buffer.from(content, \"utf8\"), \"entry comment goes here\");\n// add local file\nzip.addLocalFile(\"/home/me/some_picture.png\");\n// get everything as a buffer\nvar willSendthis = zip.toBuffer();\n// or write everything to disk\nzip.writeZip(/*target file name*/ \"/home/me/files.zip\");\n\n// ... more examples in the wiki\n```\n\nFor more detailed information please check out the [wiki](https://github.com/cthackers/adm-zip/wiki).\n\n## Electron original-fs\n\nADM-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.\n\nExample:\n\n```javascript\nconst AdmZip = require(\"adm-zip\");\nconst OriginalFs = require(\"original-fs\");\n\n// reading archives\nconst zip = new AdmZip(\"./my_file.zip\", { fs: OriginalFs });\n.\n.\n.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcthackers%2Fadm-zip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcthackers%2Fadm-zip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcthackers%2Fadm-zip/lists"}