{"_id":"7zip-wrapper","_rev":"2-e84c8970af64b557e8abda3da0468ad5","name":"7zip-wrapper","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"7zip-wrapper","version":"0.0.1","keywords":["7zip","7-zip","archive","compression","extract","zip","7z","tar","gzip","bzip2","xz","rar","iso","wrapper","nodejs","typescript"],"author":{"name":"Iqbal Rashed"},"license":"MIT","_id":"7zip-wrapper@0.0.1","maintainers":[{"name":"rashed_iqbal","email":"dev.rashediqbal@gmail.com"}],"homepage":"https://github.com/iqbal-rashed/7zip-wrapper#readme","bugs":{"url":"https://github.com/iqbal-rashed/7zip-wrapper/issues"},"bin":{"7zip":"dist/cli.js"},"dist":{"shasum":"abf0b9389dfae070ec2802788449fbf6affbdee6","tarball":"https://registry.npmjs.org/7zip-wrapper/-/7zip-wrapper-0.0.1.tgz","fileCount":9,"integrity":"sha512-zJObxGfDXmcAHab9wpVm25bzApPGy5Tk82zMeSDbykHaTcDn/r9ypX9PcbbsO7ZlNDnJy1qStJC2hRQq2z51hA==","signatures":[{"sig":"MEQCIB/7w5uep9zUAAtVunyJBx7BDUvLuctXO9+Py4mGgaAEAiBmkV7roo6hqpQvOZXyYp4p6uXzMEZhRUGpWRxVZjog9Q==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":87249},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","default":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"b80b85cf65da63bf2949e76f6fca54571772369d","scripts":{"dev":"tsup --watch","lint":"eslint .","test":"vitest run","build":"tsup","format":"prettier --write .","lint:fix":"eslint . --fix","typecheck":"tsc --noEmit","test:watch":"vitest","postinstall":"node -e \"process.env.INIT_CWD !== process.cwd() && require('child_process').execSync('npm run postdownload', { stdio: 'inherit' });\"","format:check":"prettier --check .","postdownload":"node ./dist/postinstall.js","test:coverage":"vitest --coverage","prepublishOnly":"npm run build"},"_npmUser":{"name":"rashed_iqbal","email":"dev.rashediqbal@gmail.com"},"repository":{"url":"git+https://github.com/iqbal-rashed/7zip-wrapper.git","type":"git"},"_npmVersion":"10.9.4","description":"A comprehensive, feature-complete Node.js wrapper for 7-Zip with TypeScript support, bundled binaries, and cross-platform compatibility.","directories":{},"sideEffects":false,"_nodeVersion":"22.21.1","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","eslint":"^9.18.0","vitest":"^4.0.16","globals":"^15.14.0","prettier":"^3.4.2","@eslint/js":"^9.18.0","typescript":"^5.9.3","@types/node":"^22.10.5","typescript-eslint":"^8.19.1","@vitest/coverage-v8":"^4.0.16"},"_npmOperationalInternal":{"tmp":"tmp/7zip-wrapper_0.0.1_1766591157732_0.44742288090853743","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"7zip-wrapper","version":"0.0.2","description":"A comprehensive, feature-complete Node.js wrapper for 7-Zip with TypeScript support, bundled binaries, and cross-platform compatibility.","main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","require":"./dist/index.js","import":"./dist/index.mjs","default":"./dist/index.js"}},"bin":{"7zip":"dist/cli.js"},"sideEffects":false,"scripts":{"build":"tsup","dev":"tsup --watch","test":"vitest run","test:watch":"vitest","test:coverage":"vitest --coverage","lint":"eslint .","lint:fix":"eslint . --fix","format":"prettier --write .","format:check":"prettier --check .","typecheck":"tsc --noEmit","prepublishOnly":"npm run build","postdownload":"node ./dist/postinstall.js","postinstall":"node -e \"process.env.INIT_CWD !== process.cwd() && require('child_process').execSync('npm run postdownload', { stdio: 'inherit' });\""},"keywords":["7zip","7-zip","archive","compression","extract","zip","7z","tar","gzip","bzip2","xz","rar","iso","wrapper","nodejs","typescript"],"license":"MIT","engines":{"node":">=18.0.0"},"author":{"name":"Iqbal Rashed"},"repository":{"type":"git","url":"git+https://github.com/iqbal-rashed/7zip-wrapper.git"},"bugs":{"url":"https://github.com/iqbal-rashed/7zip-wrapper/issues"},"homepage":"https://github.com/iqbal-rashed/7zip-wrapper#readme","devDependencies":{"@eslint/js":"^9.18.0","@types/node":"^22.10.5","@vitest/coverage-v8":"^4.0.16","eslint":"^9.18.0","globals":"^15.14.0","prettier":"^3.4.2","tsup":"^8.5.1","typescript":"^5.9.3","typescript-eslint":"^8.19.1","vitest":"^4.0.16"},"dependencies":{},"_id":"7zip-wrapper@0.0.2","gitHead":"bc5dde34a1af13212e59ccfa0d30d0d3931208da","_nodeVersion":"22.21.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-tZkpRFB6hArFUJt+OeJHuOuGTL6ZCL+ZA93Bs2dVvJ+lZMHMTfylCeFUrYAguQXEBus49KuEWmYudFQWz8+MdA==","shasum":"5b70bc33c507937fecb741b0a9f2b9044b95eb31","tarball":"https://registry.npmjs.org/7zip-wrapper/-/7zip-wrapper-0.0.2.tgz","fileCount":9,"unpackedSize":97608,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDZVa5Mt12sOVVrBmPVnyJqbP6J56sspp15qqZZwAuf/AiBBneLm+KvjdnOK/rTB74eQ+0nELd2m1CNHRw3TCaD4HA=="}]},"_npmUser":{"name":"rashed_iqbal","email":"dev.rashediqbal@gmail.com"},"directories":{},"maintainers":[{"name":"rashed_iqbal","email":"dev.rashediqbal@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/7zip-wrapper_0.0.2_1766679957050_0.889605023499634"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-24T15:45:57.731Z","modified":"2025-12-25T16:25:57.409Z","0.0.1":"2025-12-24T15:45:57.913Z","0.0.2":"2025-12-25T16:25:57.206Z"},"bugs":{"url":"https://github.com/iqbal-rashed/7zip-wrapper/issues"},"author":{"name":"Iqbal Rashed"},"license":"MIT","homepage":"https://github.com/iqbal-rashed/7zip-wrapper#readme","keywords":["7zip","7-zip","archive","compression","extract","zip","7z","tar","gzip","bzip2","xz","rar","iso","wrapper","nodejs","typescript"],"repository":{"type":"git","url":"git+https://github.com/iqbal-rashed/7zip-wrapper.git"},"description":"A comprehensive, feature-complete Node.js wrapper for 7-Zip with TypeScript support, bundled binaries, and cross-platform compatibility.","maintainers":[{"name":"rashed_iqbal","email":"dev.rashediqbal@gmail.com"}],"readme":"# 7zip-wrapper\n\n> **A powerful, type-safe Node.js wrapper for 7-Zip with native Stream & Buffer support.**\n\n[![npm version](https://img.shields.io/npm/v/7zip-wrapper.svg)](https://www.npmjs.com/package/7zip-wrapper)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue.svg)](https://www.typescriptlang.org/)\n\n**7zip-wrapper** provides a modern, Promise-based API for 7-Zip operations. It bundles the 7-Zip binary for Windows, Linux, and macOS, ensuring zero configuration and reliable execution everywhere.\n\n## ✨ Features\n\n- **🔋 Bundled Binaries**: No external dependencies or system installations required. Works out of the box.\n- **🌊 Stream Support**: Pipe data directly into archives (`addFromStream`) and out of archives (`extractToStream`).\n- **💾 Buffer Support**: Extract files directly to memory (`extractToBuffer`) or add Buffers to archives.\n- **📦 Multi-Format**: Support for **7z**, **ZIP**, **TAR**, **GZIP**, **XZ**, and reading **RAR**.\n- **🔒 Security**: Full password protection and header encryption support.\n- **🚀 TypeScript**: Written in TypeScript with complete type definitions.\n- **📈 Progress Monitoring**: Real-time progress updates for long-running operations.\n\n---\n\n## 📦 Installation\n\n```bash\nnpm install 7zip-wrapper\n```\n\n---\n\n## 🚀 Quick Start\n\n### Object-Oriented API (Recommended)\n\nThe `ZipWrapper` class provides a clean, fluent interface for all operations.\n\n```typescript\nimport { ZipWrapper } from '7zip-wrapper';\n\nconst zip = new ZipWrapper();\n\n// 1. Create an archive\nawait zip.add('backup.7z', ['src/', 'package.json'], {\n  level: 9,\n  password: 'secret-password',\n});\n\n// 2. Extract an archive\nawait zip.extract('backup.7z', {\n  outputDir: './restored',\n  overwrite: true,\n});\n```\n\n### Functional API\n\nIf you prefer functions over classes, you can import them directly:\n\n```typescript\nimport { add, extract, list } from '7zip-wrapper';\n\nawait add('archive.zip', 'files/', { type: 'zip' });\nawait extract('archive.zip', { outputDir: 'out' });\n```\n\n---\n\n## 🌊 Streams & Buffers (New!)\n\nHandle data efficiently without writing to temporary files.\n\n### Streaming **Into** an Archive\n\nPipe a Readable stream (or Buffer) directly into an archive entry.\n\n```typescript\nimport { Readable } from 'stream';\n\nconst myStream = Readable.from(['Hello World']);\nawait zip.addFromStream('archive.7z', 'hello.txt', myStream);\n```\n\n### Streaming **Out of** an Archive\n\nGet a Readable stream for a file inside an archive.\n\n```typescript\nconst readStream = zip.extractToStream('archive.7z', 'large-file.log');\nreadStream.pipe(process.stdout);\n```\n\n### Working with Buffers\n\nRead a file from an archive directly into memory.\n\n```typescript\nconst buffer = await zip.extractToBuffer('assets.7z', 'config.json');\nconst config = JSON.parse(buffer.toString());\n```\n\n---\n\n## 📚 API Reference\n\n### Core Operations\n\n#### `add(archive, files, options)`\n\nCreate or update an archive.\n\n| Option             | Type      | Description                                       |\n| ------------------ | --------- | ------------------------------------------------- |\n| `type`             | `string`  | Archive format (`7z`, `zip`, `tar`, `gzip`, etc.) |\n| `level`            | `0-9`     | Compression level (0=store, 9=ultra)              |\n| `password`         | `string`  | Password for encryption                           |\n| `encryptFilenames` | `boolean` | Encrypt file names (Head encryption)              |\n| `recursive`        | `boolean` | Recurse into subdirectories (default: `true`)     |\n\n#### `extract(archive, options)`\n\nExtract files from an archive.\n\n| Option      | Type       | Description                        |\n| ----------- | ---------- | ---------------------------------- |\n| `outputDir` | `string`   | Destination directory              |\n| `files`     | `string[]` | Specific files/patterns to extract |\n| `overwrite` | `boolean`  | Overwrite existing files           |\n| `password`  | `string`   | Password for decryption            |\n\n### Advanced Usage\n\n#### Progress Events\n\nMonitor operation progress for UI feedback.\n\n```typescript\nawait zip.add('big-archive.7z', 'data/', {\n  onProgress: (progress) => {\n    console.log(`Processing: ${progress.percent}% (${progress.file})`);\n  },\n});\n```\n\n#### Quick Helpers\n\nFor simple, one-off tasks without configuration.\n\n```typescript\nimport { quick } from '7zip-wrapper';\n\nawait quick.zip(['file1.txt'], 'archive.zip'); // Max compression ZIP\nawait quick.sevenz(['file1.txt'], 'archive.7z'); // Max compression 7z\nawait quick.extract('archive.7z', 'output/');\n```\n\n---\n\n## 📂 Supported Formats\n\n| Format | Read | Write |\n| ------ | ---- | ----- |\n| 7z     | ✅   | ✅    |\n| ZIP    | ✅   | ✅    |\n| TAR    | ✅   | ✅    |\n| GZIP   | ✅   | ✅    |\n| XZ     | ✅   | ✅    |\n| RAR    | ✅   | ❌\\*  |\n\n_\\*RAR creation is not supported by 7-Zip open source binaries._\n\n---\n\n## 🛠 Project Structure\n\n- **`src/`**: TypeScript source code.\n- **`examples/`**: Ready-to-run usage examples.\n\n## 📄 License\n\nMIT © [Rashed Iqbal](https://github.com/iqbal-rashed)\n","readmeFilename":"README.md"}