1.1.4 • Published 6 months ago

@damonware/zip v1.1.4

Weekly downloads
-
License
ISC
Repository
-
Last release
6 months ago

Description

@damonware/zip is a module for creating .zip files. It runs a WebAssembly binary behind the scenes that was created using Rust.

Install

npm install @damonware/zip

Usage

import { ZipFile } from '@damonware/zip';

const fileInput = document.getElementById("fileInput");

const zipFile = new ZipFile();
const zipFileResult = await zipFile
    .addFile(fileInput.files[0])
    .addFiles(fileInput.files)
    .addFileBuffer("numbers.bin", new Uint8Array([1,2,3]))
    .zip();

console.log(zipFileResult.buffer); // Uint8Array

zipFileResult.download("files.zip"); // Trigger browser download

The first call to ZipFile#zip will automatically instantiate the WebAssembly module. If you would like to perform this action as a separate step, you can do the following:

await zipFile.init();

Initialisation will only occur once, regardless of how many ZipFile instances you create.

1.1.4

6 months ago

1.1.3

6 months ago

1.1.2

6 months ago

1.1.1

6 months ago

1.1.0

6 months ago

1.0.10

6 months ago

1.0.9

6 months ago

1.0.8

6 months ago

1.0.7

6 months ago

1.0.6

6 months ago

1.0.5

6 months ago

1.0.4

6 months ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago