{"id":35099281,"url":"https://github.com/hackash/node-hk-zip","last_synced_at":"2026-04-25T01:38:52.011Z","repository":{"id":143897713,"uuid":"225322638","full_name":"hackash/node-hk-zip","owner":"hackash","description":"NODE JS unzip implementation","archived":false,"fork":false,"pushed_at":"2020-07-28T13:03:00.000Z","size":301,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-23T17:47:14.255Z","etag":null,"topics":["archived","buffer","deflate","inflate","nodejs","typescript","unzip","unzipping-files","zlib"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/hackash.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","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":"2019-12-02T08:24:26.000Z","updated_at":"2022-02-28T20:59:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"a56bb896-6f8f-432a-8a3e-d1b39d0f74cb","html_url":"https://github.com/hackash/node-hk-zip","commit_stats":{"total_commits":47,"total_committers":2,"mean_commits":23.5,"dds":"0.021276595744680882","last_synced_commit":"06f9b238577149acea39d02b09dc17168052ab60"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/hackash/node-hk-zip","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackash%2Fnode-hk-zip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackash%2Fnode-hk-zip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackash%2Fnode-hk-zip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackash%2Fnode-hk-zip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hackash","download_url":"https://codeload.github.com/hackash/node-hk-zip/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackash%2Fnode-hk-zip/sbom","scorecard":{"id":452099,"data":{"date":"2025-08-11","repo":{"name":"github.com/hackash/node-hk-zip","commit":"06f9b238577149acea39d02b09dc17168052ab60"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build-test.yaml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build-test.yaml:8: update your workflow using https://app.stepsecurity.io/secureworkflow/hackash/node-hk-zip/build-test.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build-test.yaml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/hackash/node-hk-zip/build-test.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build-test.yaml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/hackash/node-hk-zip/build-test.yaml/master?enable=pin","Info:   0 out of   1 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T08:27:09.583Z","repository_id":143897713,"created_at":"2025-08-19T08:27:09.583Z","updated_at":"2025-08-19T08:27:09.583Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32247508,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["archived","buffer","deflate","inflate","nodejs","typescript","unzip","unzipping-files","zlib"],"created_at":"2025-12-27T16:32:11.149Z","updated_at":"2026-04-25T01:38:52.001Z","avatar_url":"https://github.com/hackash.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NodeJS unzip implementation\n\n\u003e This module has been developed for a specific use case (unzipping specific files with a flexible API). It supports only the most common compression method deflate. There are some missing features, such as CRC check, encrypted files, and ZIP 64 support. I plan to add them later. if you like this and want to enhance/add missing features or add more public functions, feel free to come up with a pull request, but before doing that, please check [CONTRIBUTING.md](https://github.com/hackash/node-hk-zip/blob/master/.github/CONTRIBUTING.md)\n\n\n## Motivation \n\n\u003e Most of the open-source ZIP libraries are written in old javascript, weakly tested, not well structured, and mostly depending on other open-source libraries, which makes it hard to manage, perform patches, and updates. This module is written in Typescript. Which allows to create more abstractions around the idea, provides type checking and OOP capabilities.\n\n\n## Good sides \n\n- Fully typed thanks to Typescript \n- 0 external dependencies \n- Easy to scale \n- Easy to test \n- Flexible API\n\n## Todo list\n\n- ~~Implement CRC-32 check~~\n- Add support for encrypted ZIPs  \n- Add support for more compression methods  \n- Add support for ZIP64 \n- Add zipping functionality \n- Add streaming API \n- Add more unit tests\n\n  \n## Installation \n\n#### NPM \n\n```npm install node-hk-zip```\n\n#### Yarn\n\n```yarn add node-hk-zip``` \n\n\n## Getting started\n\n``` \n import fs from 'fs';\n \n import {ZipFile, ZipEntry} from 'node-hk-zip';\n \n const data: Buffer = fs.readFileSync('..some zip file path'); // IMPORTANT: Usage of sync method for demo purposes only\n \n const zip: ZipFile = new ZipFile(data);\n const entries: ZipEntry[] = zip.listAllEntries();\n \n entries.forEach((e: ZipEntry) =\u003e {\n    console.log(e.describe());\n    console.log(e.decompress());\n });\n```\n\n## ZipFile API\n\nList all entries in the ZIP file - `listAllEntries(): ZipEntry[]` \n\n\n``` \n const zip: ZipFile = new ZipFile(data);\n const entries: ZipEntry[] = zip.listAllEntries();\n \n entries.forEach((e: ZipEntry) =\u003e {\n    console.log(e.describe());\n });\n```\n\n\u003e Sample output\n\n```\n{ isDirectory: false, name: 'test.png', path: 'test.png' }\n{ isDirectory: true, name: '__MACOSX', path: '__MACOSX/' }\n{ isDirectory: false, name: '._test.png', path: '__MACOSX/._test.png' }\n{ isDirectory: false, name: 'test.txt', path: 'test.txt' }\n{ isDirectory: false, name: '._test.txt',path: '__MACOSX/._test.txt' }\n```\n\nFind an entry in the ZIP file - `findEntries(string[]): ZipEntry[]` \n\n\n``` \n const zip: ZipFile = new ZipFile(data);\n const paths: string[] = ['test.png'];\n const entries: ZipEntry[] = zip.findEntries(paths);\n \n entries.forEach((e: ZipEntry) =\u003e {\n    console.log(e.describe());\n });\n```\n\n\u003e Sample output\n\n```\n{ isDirectory: false, name: 'test.png', path: 'test.png' }\n```\n\nFind matching entries by RegExp - `findMatchingEntries(reg: RegExp[]): ZipEntry[]` \n\n\n``` \n const zip: ZipFile = new ZipFile(data);\n const regs: RegExp = [/^[a-z]+\\.(png)/, /^[a-z]+\\.(txt)/];\n const entries: ZipEntry[] = zip.findMatchingEntries(regs);\n \n entries.forEach((e: ZipEntry) =\u003e {\n    console.log(e.describe());\n });\n```\n\n\u003e Sample output\n\n```\n{ isDirectory: false, name: 'test.png', path: 'test.png' }\n{ isDirectory: false, name: 'test.txt', path: 'test.txt' }\n```\n\n## ZipEntry API\n\nDecompress file data - `decompress(): Promise\u003cBuffer\u003e` \n\n``` \n const zip: ZipFile = new ZipFile(data);\n const paths: string[] = ['test.png'];\n const entries: ZipEntry[] = zip.findEntries(paths);\n \n entries.forEach(async (e: ZipEntry) =\u003e {\n   const info = e.describe();\n   const data = await e.decompress();\n   fs.writeFileSync(info.name, data); // IMPORTANT: Usage of sync method for demo purposes only\n });\n```\n\n\u003e Sample output\n\nWrites decompressed `test.png` under project root.  \n\nGetter for LocalFileHeader size - `getLocalHeaderSize(): number` \n\n``` \n const zip: ZipFile = new ZipFile(data);\n const paths: string[] = ['test.png'];\n const entries: ZipEntry[] = zip.findEntries(paths);\n \n entries.forEach(async (e: ZipEntry) =\u003e {\n   console.log(e.getLocalHeaderSize());\n });\n```\n\n\u003e Sample output\n\nPrints `LocalFileHeader` size   \n\n\nChecks if the entry is a directory - `isDirectory(): boolean` \n\n``` \n const zip: ZipFile = new ZipFile(data);\n const paths: string[] = ['__MACOSX/'];\n const entries: ZipEntry[] = zip.findEntries(paths);\n \n entries.forEach(async (e: ZipEntry) =\u003e {\n   console.log(e.isDirectory());\n });\n```\n\n\u003e Sample output\n\n`ture // __MACOSX/' is a directory`\n\nGetter for entry name - `getName(): string` \n\n``` \n const zip: ZipFile = new ZipFile(data);\n const paths: string[] = ['test.png'];\n const entries: ZipEntry[] = zip.findEntries(paths);\n \n entries.forEach(async (e: ZipEntry) =\u003e {\n   console.log(e.getName());\n });\n```\n\n\u003e Sample output\n\nPrints `test.png`   \n\nGetter for entry's full path in the zip file - `getPath(): string` \n\n```\n const zip: ZipFile = new ZipFile(data);\n const paths: string[] = ['__MACOSX/._test.png'];\n const entries: ZipEntry[] = zip.findEntries(paths);\n \n entries.forEach(async (e: ZipEntry) =\u003e {\n   console.log(e.getPath());\n });\n```\n\n\u003e Sample output\n\nPrints `__MACOSX/._test.png`   \n\nDescribe entry in the zip file - `describe(): IZipEntryDescription` \n\n``` \n const zip: ZipFile = new ZipFile(data);\n const paths: string[] = ['test.png'];\n const entries: ZipEntry[] = zip.findEntries(paths);\n \n entries.forEach(async (e: ZipEntry) =\u003e {\n   console.log(e.describe());\n });\n```\n\n\u003e Sample output\n\n```\n{ isDirectory: false, name: 'test.png', path: 'test.png' }\n```\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackash%2Fnode-hk-zip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhackash%2Fnode-hk-zip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackash%2Fnode-hk-zip/lists"}