Catalog npm
Back to packageRELEASE DETAILS

1.0.2

npm

7z-wasm

7-Zip for JavaScript environments, compiled to WASM

7-zip7z7zip7zzarchivebzbz2gznsisrartarwasmzip
Published22 Mar 2023
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": "b6974743fa690a64681aa5861411144cd07aba15",
  "tarball": "https://registry.npmjs.org/7z-wasm/-/7z-wasm-1.0.2.tgz",
  "fileCount": 10,
  "integrity": "sha512-HyqFcihZoM9u897gjcAVGFHb7AFBg8TrcfgSSA5mP4j5MkWYElAt+n/XoPuPQMll+mcbcp+9GmS+nPG1jDy8Yw==",
  "signatures": [
    {
      "sig": "MEUCIAwUtL1djFm34Ts4A+trxaIREjVvvvl1eN6ieQpKCy3EAiEAhZo2wEe20uIToLXLAx6ombE5GEzicRRejxZLVWnDIMI=",
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
    }
  ],
  "unpackedSize": 2461886,
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkGttDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoBvg//RG7bCJwmLz+fRLVEE+CUaI5qPLSvl6VbV9h6jIbDeHktyTs9\r\n282/bewe2YXOxCFEClSdeHE9IIUAn3W7S1RM5EMNkyzlGkHLk5aRVVw2uY9D\r\nb7kB+hLEqKMDZLDlWVtSfuYk+Gp1GrvpXr42tSD1lYuEQsEBwSwyNsKUznIy\r\nZqqTYtSEY/K+uWM4/i31p32T+A4++hy25I+EEGPit7TucVGoWOJ+sVKfTFrJ\r\nj2Z1mE23zvU8QZUi/UtzCp4WOANDc5yLlje0ETrPHQl3v4hpcesJRtFKNco+\r\nbYDeRzgzHP8u0xJri6dceRpXE/aqoSuPQeBf7SdRn7BkR7S0RgHw4WnZaaHD\r\nnRFcVarFCzPVpLB/wUHbARUDsEuY2f5SIrqfu9771RxjBmVxyBUMN6cjpVag\r\n9SvSFQl2RMCKuH0n3S92s6CzxvYZQp1scOPfHWDnoJVtXk32vJKN177omQPS\r\nl5MtiXpFEVAJoyBh05GsHFloS7GUgVstDiNQBtLfgoodrr8yDVKXIpCkfdYn\r\nvgBI/Ef1mcAVfoqYidj/97zGvuxfpej2QOhyPLtkZdnQRoWmZsx/LOKnZfyX\r\nVlt+1AzNHw6UiIIAC4UcYKVdwpBPD71xI9YpPwe3ck3sSu9VrhQpFWaiOr6J\r\nM6GgG6+NeLVMfwAB/wq75gtuEu1VYXjozQg=\r\n=8EDm\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:abe5e7909c15fc3c69a490bef24d84df684577aa53f94a050680ac6bb6e59d44

Other collected versions

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