Catalog npm
Back to packageRELEASE DETAILS

1.0.0-beta.5

npm

7z-wasm

7-Zip for JavaScript environments, compiled to WASM

7-zip7z7zip7zzarchivebzbz2gznsisrartarwasmzip
Published12 Sept 2021
Direct dependencies1
Transitive dependenciesNot calculated

README

Current package documentation

7-Zip WASM

7-Zip compiled to WASM with emscripten. Based on 7-Zip 24.09 (2024-11-29).

  • Runs in any JavaScript environment that supports WASM (Browser or NodeJS)
  • Supports all file formats that the full 7zz CLI supports.
  • Only Emscripten NODEFS and WORKERFS adapters are included by default.

Inspired by https://github.com/sonictruth/7zip.js

Usage

Command-line

npx 7z-wasm --help

or

npm i -g 7z-wasm
7z-wasm --help

As a module

import SevenZip from "7z-wasm";

const sevenZip = await SevenZip();

const archiveData = new Uint8Array(100);
const archiveName = "archive.7z";

const stream = sevenZip.FS.open(archiveName, "w+");
sevenZip.FS.write(stream, archiveData, 0, archiveData.length);
sevenZip.FS.close(stream);

const filesToExtract = ["some-file.txt"];
sevenZip.callMain(["x", archiveName, ...filesToExtract]);
console.log(sevenZip.FS.readFile(filesToExtract[0]));

Working with the real file system (Node.JS only)

import SevenZip from "7z-wasm";

const mountRoot = "/nodefs";
sevenZip.FS.mkdir(mountRoot);
sevenZip.FS.mount(sevenZip.NODEFS, { root: "/real/root/folder" }, mountRoot);
sevenZip.FS.chdir(mountRoot + "/subfolder");

sevenZip.callMain(["x", "archive.7z", "some-file.txt"]);

Building

Because the 7-Zip sources are not available on GitHub, the build process relies on downloading the sources from the 7-Zip website and patching them so they compile with emcc.

  • Install docker
  • Execute ./build (or .\build, respectively, on Windows CMD)

You can pass custom options to emcc via env file (e.g. see build-umd.env)

Downloads & popularity

Awaiting observations

No metric observations yet

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

Declared dependencies 1

Native requirements
1 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
readline-sync
Environment
{
  "local_name": "readline-sync",
  "alias": false,
  "peer_metadata": null
}
^1.4.10runtime

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "13e5503ddda5fc9db566abbb971ec7caaa3f538c",
  "tarball": "https://registry.npmjs.org/7z-wasm/-/7z-wasm-1.0.0-beta.5.tgz",
  "fileCount": 10,
  "integrity": "sha512-D+E7iVpWhq7MYLv5sQKoJq1tkiQ1ZWSBx2x8evd1qe9UEAekOuu/xndQD4YMI6jWz8sFJ8QqWzSTVeELelv5Kg==",
  "signatures": [
    {
      "sig": "MEYCIQCBQBpwhe/n6omE/zKyLLZDv02jqiadvbIpCIAn/d8gWQIhAJnwO9BK6rh9Epi/iRHOFp95uROaArRRGpcok2Q4ij0x",
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
    }
  ],
  "unpackedSize": 2342765,
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhPa/RCRA9TVsSAnZWagAAGyAP/1Vvz+B0S0VNjiODZATh\nkhRhO6yNMYgAbfPc6fdCQZOqzWYAs2jQS2QrxaGOxKL0BTPqdTWNXPFLNvHz\nC4OpsJi+3Fsss5NLDiwqg0IIDgowW6/OVfU9sRF2QYLao0bORMGnZll78raS\n78DDxdPfOjZogYwHFcYgh7bNYK5DV9hD1FvxOjXkcmPYRUtxVcn9f4EUxIcy\n0W6EVX84+pxa+ZaS5b4Xrvtz1jo7T0AyXTG3y3M73dB5xP0aPQpUor1003Kp\nOGaSBEgKSv0Jx9oBu+IGazV9JnhKIyvNeBBACHd4fN/PHLj9WdDuNCublNiG\n/Y0x2j1J1q+ZpfCToEd/GahNQLS0SK0P5AQ1XjlItwNvpa2tcHGaMeyG/FKe\nbI8BzDFs3jAsE3ZkU3sVZ7gJJ7+E2eeJPFHOVX9lNj9AV8WMVVDTwwsQwJEE\n7lwERqCG/g486HpuTx3Ed64l2bohVHDvV24VQQRcdvcjKoHb/vgycmsMUUmb\nJab9K80uZDvlWk7+BG37dMqf4YFSE+KmjSn5gG7gFGThItqyBWexJqaM1x8q\nmXf+7vwgx9BhzTP1Zd6keyfRABInA7J/ZYmvc3NbsZUUuWhkXK3rP+W4UYAm\nGRLtFswbfGtYMlRq5NMRLVb6AJMUBRMgYmGgPHhrRBoWBO3v6yrLhRvt3/nb\nIxSk\r\n=2XHD\r\n-----END PGP SIGNATURE-----\r\n"
}

Repository

PENDING
use-strict/7z-wasm

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 21:14 UTC

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

Record identity

package_version:db3bc1d1eb079ecd2e8b98cd23d5ca31a38f68e1a2a21be0e662593a702d6e00

Other collected versions

1.2.023 Jun1.1.016 Oct1.0.222 Mar1.0.130 Aug1.0.030 Aug1.0.0-beta.44 SeptView all collected versions →