{"id":15711822,"url":"https://github.com/onikienko/7zip-min","last_synced_at":"2026-03-01T22:11:46.801Z","repository":{"id":33048244,"uuid":"150584151","full_name":"onikienko/7zip-min","owner":"onikienko","description":"Minimal standalone cross-platform pack/unpack with 7-zip for Node.js","archived":false,"fork":false,"pushed_at":"2026-02-18T04:24:09.000Z","size":686,"stargazers_count":52,"open_issues_count":23,"forks_count":18,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-02-18T09:33:50.904Z","etag":null,"topics":["7zip","nodejs"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/7zip-min","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/onikienko.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-09-27T12:35:12.000Z","updated_at":"2025-12-21T15:06:10.000Z","dependencies_parsed_at":"2024-10-24T09:40:11.846Z","dependency_job_id":"bd003381-bd83-492e-9efe-321394a41cd9","html_url":"https://github.com/onikienko/7zip-min","commit_stats":{"total_commits":120,"total_committers":7,"mean_commits":"17.142857142857142","dds":"0.41666666666666663","last_synced_commit":"87ec6a8db50cfed9f06663076abc46655a586289"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/onikienko/7zip-min","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onikienko%2F7zip-min","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onikienko%2F7zip-min/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onikienko%2F7zip-min/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onikienko%2F7zip-min/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/onikienko","download_url":"https://codeload.github.com/onikienko/7zip-min/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onikienko%2F7zip-min/sbom","scorecard":{"id":707341,"data":{"date":"2025-08-11","repo":{"name":"github.com/onikienko/7zip-min","commit":"faa64f46ace7ea539df1cf73ad88cd631963dabd"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.3,"checks":[{"name":"Code-Review","score":1,"reason":"Found 1/10 approved changesets -- score normalized to 1","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":"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":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"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":"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":-1,"reason":"no workflows found","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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"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 22 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"}},{"name":"Vulnerabilities","score":3,"reason":"7 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-x4c5-c7rf-jjgv","Warn: Project is vulnerable to: GHSA-h5c3-5r3r-rr8q","Warn: Project is vulnerable to: GHSA-rmvr-2pp2-xj38","Warn: Project is vulnerable to: GHSA-xx4v-prfh-6cgc","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-cxrh-j4jr-qwg3"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-22T07:03:46.206Z","repository_id":33048244,"created_at":"2025-08-22T07:03:46.207Z","updated_at":"2025-08-22T07:03:46.207Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29986243,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T21:06:37.093Z","status":"ssl_error","status_checked_at":"2026-03-01T21:05:45.052Z","response_time":124,"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":["7zip","nodejs"],"created_at":"2024-10-03T21:14:03.019Z","updated_at":"2026-03-01T22:11:46.794Z","avatar_url":"https://github.com/onikienko.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 7zip-min\n\n[![npm version](https://img.shields.io/npm/v/7zip-min.svg)](https://www.npmjs.com/package/7zip-min)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\nMinimal cross-platform pack/unpack (and any command) with **7-zip** for Node.js.   \nIt does not require **7zip** to be installed on your system. \nThis package includes a standalone **7za** version of **7-Zip** (uses precompiled binaries from [7zip-bin](https://github.com/develar/7zip-bin) package).\n\n## Features\n\n- Includes precompiled 7za binaries from [7zip-bin](https://github.com/develar/7zip-bin)\n- Works on Windows, macOS, and Linux\n- Works with Electron apps\n- Full TypeScript type definitions included\n- Supports Promises and callbacks\n- Supports Node.js v10+\n\n## Quick Start\n\n```bash\nnpm install 7zip-min\n```\n\n```javascript\nimport _7z from '7zip-min';\n\n// Create an archive\nawait _7z.pack('myFolder', 'archive.7z');\n\n// Extract an archive\nawait _7z.unpack('archive.7z', 'outputFolder');\n\n// List archive contents\nconst files = await _7z.list('archive.7z');\nconsole.log(files);\n```\n\u003e 💡 **Tip:** You can also extract specific files with [`unpackSome()`](#unpacksomepathtoarch-filestounpack-destpath-callback) or run custom 7z commands with [`cmd()`](#cmdparamsarr-callback). See the [API Methods](#api-methods) section for details.\n\n## Table of Contents\n\n- [Supported Archive Formats](#supported-archive-formats)\n- [Supported Platforms](#supported-platforms)\n- [Import](#import)\n- [API Methods](#api-methods)\n- [Configuration](#configuration)\n- [Examples](#examples)\n- [Electron Usage](#electron-usage)\n- [Error Handling](#error-handling)\n\n## Supported Archive Formats\n\nAccording to the [7-Zip documentation](https://web.mit.edu/outland/arch/i386_rhel4/build/p7zip-current/DOCS/MANUAL/), 7za supports:\n\n**7z** · **lzma** · **cab** · **zip** · **gzip** · **bzip2** · **Z** · **tar** \n\n\n## Supported Platforms\n\n| Platform | Architectures |\n|----------|---------------|\n| **Windows** | x86, x64 |\n| **macOS** | Apple Silicon (arm64), Intel (x64) |\n| **Linux** | arm, arm64, ia32, x64 |\n\n**Node.js**: v10 and above  \n**Electron**: Supported (see [Electron usage](#electron-usage) below)\n\nFor more platform details, see the [7zip-bin](https://github.com/develar/7zip-bin) repository. \n\n\n## Import\n\n```javascript\n// ES6 Module syntax\nimport _7z from '7zip-min';\n\n// Named imports also supported\nimport { unpack, pack, list, cmd, config, getConfig } from '7zip-min';\n\n// or use CommonJS syntax, if you prefer\nconst _7z = require('7zip-min');\n```\n\n## API Methods\n\nAll methods return a `Promise` and also support standard Node.js callbacks as the last argument. The Promise resolves with the standard output (stdout) of the 7z command (except `list()` which returns an array of objects).\n\n### `pack(pathToSrc, pathToArch, [callback])`\n\nCreates an archive from a file or directory.\n\n**Parameters:**\n- `pathToSrc` (string): Path to file or directory to compress\n- `pathToArch` (string): Path to archive to create\n- `callback` (function, optional): Node.js callback function\n\n**Returns:** Promise\\\u003cstring\\\u003e - stdout of 7z command\n\n```javascript\nawait _7z.pack('path/to/dir', 'archive.7z');\nawait _7z.pack('path/to/file.txt', 'backup.zip');\n```\n\n### `unpack(pathToArch, [destPath], [callback])`\n\nExtracts an archive to a destination directory.\n\n**Parameters:**\n- `pathToArch` (string): Path to archive file\n- `destPath` (string, optional): Where to extract files (defaults to current directory)\n- `callback` (function, optional): Node.js callback function\n\n**Returns:** Promise\\\u003cstring\\\u003e - stdout of 7z command\n\n```javascript\n// Unpack to specific directory\nawait _7z.unpack('archive.7z', 'output/folder');\n\n// Unpack to current directory\nawait _7z.unpack('archive.zip');\n```\n\n### `unpackSome(pathToArch, filesToUnpack, [destPath], [callback])`\n\nExtracts specific files or directories from an archive.\n\n**Parameters:**\n- `pathToArch` (string): Path to archive file\n- `filesToUnpack` (string[]): Array of file/directory names or patterns to extract\n- `destPath` (string, optional): Where to extract files (defaults to current directory)\n- `callback` (function, optional): Node.js callback function\n\n**Returns:** Promise\\\u003cstring\\\u003e - stdout of 7z command\n\n```javascript\n// Extract specific files to a directory\nawait _7z.unpackSome('archive.7z', ['file1.txt', 'dir1'], 'output');\n\n// Extract with pattern to current directory\nawait _7z.unpackSome('archive.7z', ['*.txt']);\n```\n\n### `list(pathToArch, [callback])`\n\nLists contents of an archive.\n\n**Parameters:**\n- `pathToArch` (string): Path to archive file\n- `callback` (function, optional): Node.js callback function\n\n**Returns:** Promise\\\u003cListItem[]\\\u003e - Array of items in the archive\n\nEach `ListItem` object has the following properties:\n- `name` (string): **[guaranteed]** File/directory path (always present)\n- `size` (string, optional): Uncompressed size\n- `compressed` (string, optional): Compressed size\n- `date` (string, optional): Modified date\n- `time` (string, optional): Modified time\n- `attr` (string, optional): File attributes\n- `crc` (string, optional): CRC checksum\n- `method` (string, optional): Compression method\n- `encrypted` (string, optional): Encryption status\n\n\u003e **Note:** Only the `name` property is guaranteed to be present. Other properties depend on the archive format and 7z output.\n\n```javascript\nconst items = await _7z.list('archive.7z');\nitems.forEach(item =\u003e {\n  console.log(`${item.name}${item.size ? ` - ${item.size} bytes` : ''}`);\n});\n```\n\n### `cmd(paramsArr, [callback])`\n\nRuns any 7z command with custom parameters. This is a low-level method that gives you full control over 7z and returns the raw command output.\n\n**Parameters:**\n- `paramsArr` (string[]): Array of command-line arguments for 7z\n- `callback` (function, optional): Node.js callback function\n\n**Returns:** Promise\\\u003cstring\\\u003e - stdout of 7z command (raw output that you can parse or process)\n\n```javascript\n// Custom compression with ultra settings\nconst output = await _7z.cmd(['a', '-mx=9', 'ultra.7z', 'folder']);\nconsole.log(output); // Raw 7z output\n\n// Test archive integrity and get detailed report\nconst testResult = await _7z.cmd(['t', 'archive.7z']);\nif (testResult.includes('Everything is Ok')) {\n  console.log('Archive is valid');\n}\n\n// Extract with password\nawait _7z.cmd(['x', 'protected.7z', '-pMyPassword', '-ooutput']);\n```\n\n## Configuration\n\n### `getConfig()`\n\nReturns the current configuration settings.\n\n**Returns:** ConfigSettings object with:\n- `binaryPath` (string): Current path to 7za binary\n\n```javascript\nconst config = _7z.getConfig();\nconsole.log(`Using 7za binary at: ${config.binaryPath}`);\n```\n\n### `config(settings)`\n\nUpdates configuration settings.\n\n**Parameters:**\n- `settings` (object): Configuration object\n  - `binaryPath` (string, optional): Custom path to 7za binary\n\n```javascript\n// Use a custom 7za binary\n_7z.config({\n  binaryPath: '/custom/path/to/7za'\n});\n```\n\n### Custom Binary Path\n\nSometimes you may want to use a custom path to the 7za binary. Common use cases include:\n\n- **Electron apps**: When bundling with a custom location\n- **Custom builds**: Using a specific version of 7za\n- **Non-standard installations**: When 7za is installed in a custom location\n\nUse the `getConfig()` and `config()` methods shown above to get or set the binary path. For more details, see [#106](https://github.com/onikienko/7zip-min/pull/106).\n\n## Examples\n\n### Handling Output\n\nCapture the standard output from the 7z command for logging or analysis:\n\n```javascript\nconst stdout = await _7z.pack('myFolder', 'archive.7z'); \nconsole.log(stdout); // Prints 7z command output\n```\n\n### Alternative Syntax\n\nAll methods are compatible with standard Node.js callbacks and `.then()` chains:\n\n**Callback style:**\n```javascript\n_7z.unpack('archive.7z', 'output', (err, output) =\u003e {\n  if (err) return console.error(err);\n  console.log('Unpacked!', output);\n});\n```\n\n**Promise style:**\n```javascript\n_7z.list('archive.7z')\n  .then(list =\u003e console.log(list))\n  .catch(err =\u003e console.error(err));\n```\n\n## Electron Usage\n\nThis package works with Electron. The package automatically detects when running inside an Electron app and adjusts the binary path from `app.asar` to `app.asar.unpacked`.\n\nWhen using `electron-builder`, you need to ensure the 7za binaries are unpacked from the .asar archive using the [`asarUnpack`](https://www.electron.build/configuration#asarunpack) option:\n\n```json\n{\n  \"build\": {\n    \"asarUnpack\": [\n      \"node_modules/7zip-bin/**/*\"\n    ]\n  }\n}\n```\nAlternatively, you can set a custom binary path if you prefer to bundle the binary differently:\n\n```javascript\n_7z.config({\n  binaryPath: '/custom/path/to/7za'\n});\n```\n\n## Error Handling\n\nAll methods throw errors (or pass them to callbacks) when operations fail. The error object is an extended `Error` with\nadditional properties:\n\n- `message`: Error message\n- `stderr`: Standard error output from 7z\n- `stdout`: Standard output from 7z (if any)\n- `code`: Exit code from 7z process\n\n```javascript\ntry {\n  await _7z.unpack('nonexistent.7z');\n} catch (err) {\n  console.error('Error message:', err.message);\n  console.log('Exit code', err.code);\n  console.error('Standard error:', err.stderr);\n  console.error('Standard output:', err.stdout);\n}\n```\n\n## See Also\n\n- [7zip-bin](https://github.com/develar/7zip-bin) - Precompiled 7za binaries\n- [7-Zip](https://www.7-zip.org/) - Official 7-Zip website\n- [Command Line Version User's Guide](https://web.mit.edu/outland/arch/i386_rhel4/build/p7zip-current/DOCS/MANUAL/) - 7z command-line documentation\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonikienko%2F7zip-min","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonikienko%2F7zip-min","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonikienko%2F7zip-min/lists"}