Catalog npm
Back to packageRELEASE DETAILS

0.0.2

npm

7zip-wrapper

A comprehensive, feature-complete Node.js wrapper for 7-Zip with TypeScript support, bundled binaries, and cross-platform compatibility.

7-zip7z7ziparchivebzip2compressionextractgzipisonodejsrartartypescriptwrapperxzzip
Published25 Dec 2025
Direct dependencies10
Transitive dependenciesNot calculated

README

Current package documentation

7zip-wrapper

A powerful, type-safe Node.js wrapper for 7-Zip with native Stream & Buffer support.

npm version License: MIT TypeScript

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.

✨ Features

  • 🔋 Bundled Binaries: No external dependencies or system installations required. Works out of the box.
  • 🌊 Stream Support: Pipe data directly into archives (addFromStream) and out of archives (extractToStream).
  • 💾 Buffer Support: Extract files directly to memory (extractToBuffer) or add Buffers to archives.
  • 📦 Multi-Format: Support for 7z, ZIP, TAR, GZIP, XZ, and reading RAR.
  • 🔒 Security: Full password protection and header encryption support.
  • 🚀 TypeScript: Written in TypeScript with complete type definitions.
  • 📈 Progress Monitoring: Real-time progress updates for long-running operations.

📦 Installation

npm install 7zip-wrapper

🚀 Quick Start

The ZipWrapper class provides a clean, fluent interface for all operations.

import { ZipWrapper } from '7zip-wrapper';

const zip = new ZipWrapper();

// 1. Create an archive
await zip.add('backup.7z', ['src/', 'package.json'], {
  level: 9,
  password: 'secret-password',
});

// 2. Extract an archive
await zip.extract('backup.7z', {
  outputDir: './restored',
  overwrite: true,
});

Functional API

If you prefer functions over classes, you can import them directly:

import { add, extract, list } from '7zip-wrapper';

await add('archive.zip', 'files/', { type: 'zip' });
await extract('archive.zip', { outputDir: 'out' });

🌊 Streams & Buffers (New!)

Handle data efficiently without writing to temporary files.

Streaming Into an Archive

Pipe a Readable stream (or Buffer) directly into an archive entry.

import { Readable } from 'stream';

const myStream = Readable.from(['Hello World']);
await zip.addFromStream('archive.7z', 'hello.txt', myStream);

Streaming Out of an Archive

Get a Readable stream for a file inside an archive.

const readStream = zip.extractToStream('archive.7z', 'large-file.log');
readStream.pipe(process.stdout);

Working with Buffers

Read a file from an archive directly into memory.

const buffer = await zip.extractToBuffer('assets.7z', 'config.json');
const config = JSON.parse(buffer.toString());

📚 API Reference

Core Operations

add(archive, files, options)

Create or update an archive.

OptionTypeDescription
typestringArchive format (7z, zip, tar, gzip, etc.)
level0-9Compression level (0=store, 9=ultra)
passwordstringPassword for encryption
encryptFilenamesbooleanEncrypt file names (Head encryption)
recursivebooleanRecurse into subdirectories (default: true)

extract(archive, options)

Extract files from an archive.

OptionTypeDescription
outputDirstringDestination directory
filesstring[]Specific files/patterns to extract
overwritebooleanOverwrite existing files
passwordstringPassword for decryption

Advanced Usage

Progress Events

Monitor operation progress for UI feedback.

await zip.add('big-archive.7z', 'data/', {
  onProgress: (progress) => {
    console.log(`Processing: ${progress.percent}% (${progress.file})`);
  },
});

Quick Helpers

For simple, one-off tasks without configuration.

import { quick } from '7zip-wrapper';

await quick.zip(['file1.txt'], 'archive.zip'); // Max compression ZIP
await quick.sevenz(['file1.txt'], 'archive.7z'); // Max compression 7z
await quick.extract('archive.7z', 'output/');

📂 Supported Formats

FormatReadWrite
7z✅✅
ZIP✅✅
TAR✅✅
GZIP✅✅
XZ✅✅
RAR✅❌*

*RAR creation is not supported by 7-Zip open source binaries.


🛠 Project Structure

  • src/: TypeScript source code.
  • examples/: Ready-to-run usage examples.

📄 License

MIT © Rashed Iqbal

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 10

Native requirements
10 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
@eslint/js
Environment
{
  "local_name": "@eslint/js",
  "alias": false,
  "peer_metadata": null
}
^9.18.0development
@types/node
Environment
{
  "local_name": "@types/node",
  "alias": false,
  "peer_metadata": null
}
^22.10.5development
@vitest/coverage-v8
Environment
{
  "local_name": "@vitest/coverage-v8",
  "alias": false,
  "peer_metadata": null
}
^4.0.16development
eslint
Environment
{
  "local_name": "eslint",
  "alias": false,
  "peer_metadata": null
}
^9.18.0development
globals
Environment
{
  "local_name": "globals",
  "alias": false,
  "peer_metadata": null
}
^15.14.0development
prettier
Environment
{
  "local_name": "prettier",
  "alias": false,
  "peer_metadata": null
}
^3.4.2development
tsup
Environment
{
  "local_name": "tsup",
  "alias": false,
  "peer_metadata": null
}
^8.5.1development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
^5.9.3development
typescript-eslint
Environment
{
  "local_name": "typescript-eslint",
  "alias": false,
  "peer_metadata": null
}
^8.19.1development
vitest
Environment
{
  "local_name": "vitest",
  "alias": false,
  "peer_metadata": null
}
^4.0.16development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "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=="
    }
  ]
}

Repository

PENDING
iqbal-rashed/7zip-wrapper

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 21:15 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:d38e3db1fef8835b0457f13322fcfec30bb048e66ca93f8546a275863b7b3a86

Other collected versions

0.0.124 DecView all collected versions →