{"id":22713115,"url":"https://github.com/paulsmithkc/node-zip","last_synced_at":"2026-01-28T07:34:36.266Z","repository":{"id":263047020,"uuid":"889150839","full_name":"paulsmithkc/node-zip","owner":"paulsmithkc","description":"Package to efficiently read the contents of zip files","archived":false,"fork":false,"pushed_at":"2024-11-26T19:20:15.000Z","size":45,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T08:22:13.298Z","etag":null,"topics":["javascript","micro-library","nodejs","npm-package","typescript","zip"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@merlin4/zip","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paulsmithkc.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2024-11-15T17:54:50.000Z","updated_at":"2024-11-26T19:20:19.000Z","dependencies_parsed_at":"2024-11-15T20:34:34.430Z","dependency_job_id":null,"html_url":"https://github.com/paulsmithkc/node-zip","commit_stats":null,"previous_names":["paulsmithkc/node-zip"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulsmithkc%2Fnode-zip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulsmithkc%2Fnode-zip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulsmithkc%2Fnode-zip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulsmithkc%2Fnode-zip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paulsmithkc","download_url":"https://codeload.github.com/paulsmithkc/node-zip/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248752915,"owners_count":21156180,"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":["javascript","micro-library","nodejs","npm-package","typescript","zip"],"created_at":"2024-12-10T14:08:20.123Z","updated_at":"2026-01-28T07:34:36.209Z","avatar_url":"https://github.com/paulsmithkc.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @merlin4/zip\n\nThis package provides the necessary code to efficiently:\n\n1. Read the directory of ZIP files.\n2. Extract the contents from ZIP files.\n3. Recover ZIP files that are partially damaged / missing a central directory.\n\n## Usage: Read directory and unzip all files\n\n```ts\nimport { readZipDirectory, unzipToFile } from \"@merlin4/zip\";\nimport { FileHandle, open } from \"node:fs/promises\";\nimport { resolve as pathResolve } from \"node:path\";\n\nasync function main() {\n  let fileHandle: FileHandle | undefined;\n  try {\n    const zipPath = pathResolve(\"./data/example.zip\");\n    const outDir = pathResolve(\"./temp/example\");\n\n    // open zip file\n    fileHandle = await open(zipPath, \"r\");\n\n    // read the zip's table of contents\n    const directory = await readZipDirectory(fileHandle);\n\n    // unzip all of the files\n    for (const entry of directory.entries) {\n      const outPath = pathResolve(outDir, entry.fileName);\n      await unzipToFile(fileHandle, entry, outPath);\n    }\n  } finally {\n    if (fileHandle) {\n      await fileHandle.close();\n    }\n  }\n}\n\nmain();\n```\n\n## ZIP64\n\nThis package doesn't currently support the ZIP64 file format for large files (over 4GB)\n\n## Performance \u0026 Streaming\n\nCPU \u0026 Memory performance are both very important to this package. As such, a significant effort has been made to stream the data and efficiently use buffers to reduce the memory needed to process ZIP files.\n\nAs such, the code leverages low-level c-style techniques of reducing memory usage and reusing buffers where possible.\n\n## ZIP File Format\n\nWhen reviewing/modifying the code in this package please consult the specification for the ZIP file format.\n\n1. https://en.wikipedia.org/wiki/ZIP_(file_format)\n2. https://users.cs.jmu.edu/buchhofp/forensics/formats/pkzip.html\n3. https://www.loc.gov/preservation/digital/formats/fdd/fdd000354.shtml\n4. https://pkware.cachefly.net/webdocs/APPNOTE/APPNOTE-6.3.9.TXT\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulsmithkc%2Fnode-zip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaulsmithkc%2Fnode-zip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulsmithkc%2Fnode-zip/lists"}