Catalog npm
Back to packageRELEASE DETAILS

1.0.0-beta.3

npm

7z-wasm

7-Zip for JavaScript environments, compiled to WASM

7-zip7z7zip7zzarchivebzbz2gznsisrartarwasmzip
Published31 Aug 2021
Direct dependencies0
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 0

Native requirements
0 direct targetsNot calculated transitive count
No declared dependencies in this collected response

Declarations describe requirements; they are not a resolved dependency graph.

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "056ddd38b15acce13016b9dc73d39b7f8adb6b77",
  "tarball": "https://registry.npmjs.org/7z-wasm/-/7z-wasm-1.0.0-beta.3.tgz",
  "fileCount": 10,
  "integrity": "sha512-C/ZlVzqIzQ0GCF1tMD3nYFK1UGnEdGPNwcud2lHToUVXaPtDiWS20Ea9NhTRyLI3k1bYGPysEt3yRyZKHb8R8A==",
  "signatures": [
    {
      "sig": "MEQCIEKbUVwkxL35TuJTIW52U8crxdyVGCQ3uaCn91zVxFHCAiA7CshIKH33h3KtL3PT/Y54rhn/yFZwdpGM8fu4qxt7tg==",
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
    }
  ],
  "unpackedSize": 2331329,
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhLdpuCRA9TVsSAnZWagAAI5QP/0Oqyd/LDGXN1ZhBu0+v\nZ7bJ/PyIaXLs89Uo1RRyJOBV0xfbo4JknQt5/EnrcXg5tSfFm8WMpIOl+deq\nm8hN06oS/VoZ8ZnqH1QZRVqeUItNxvWkX0SRxR0JQELyVRW73tCK8RByavnB\n//dGFgInCQtSMlktQVOoWNKVlD2QC/3X1VQASW0oXzVzf64drsu4XiBskMkI\nP13M8cvUot5MK5DURcyALbppdpz43TiyrhtdasnwKIt3w1Mc9bSPRl6V9lZ3\nG+c/pKAN+28AGQRF5uG3JGKDcxNIQbiWd7B94ohXEuJj+Elbb6pOMNluVohz\nzwLqlcgaKGsGvueuvrUKMfzLPvRFkSqr8vnBrt284wRb0N/lZBhCWMp53DH6\n6T5eCzdBW3vGUIBDiF6858gJpZqyGC+GCwvsg3VbcVpxIcFgq+LOvuQ+VC8O\n48/POVFIMv2jbBYYd3dFgXfSXM3bCqT23zOJqAlaPChdOrMUDzV+S6dDwQPb\nG//E2f480Jx4cKZ1Pgh50+VWASchusQBX5GA4Ray8tfKTm6hCVHI5vVNvWx7\niHqCRfCmKkgPGge1RiwhUTr/CvEv2SNptj3WV7W/gv4vpGZEsYhe91FLmD/n\nnTz/E4QUPAt/6aqKSIpqKo5bJ/2WZrXhx9tcSDAK1fnGo92CG9wTje9W0Epv\nbFpr\r\n=y6Ci\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:d7f90b335e2b74d2c0977beb1cece357dc33f73687b6fe6e03c0b6658ba6f53f

Other collected versions

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