1.2.1 • Published 2 years ago
@damonware/zip v1.2.1
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/zipUsage
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 downloadThe 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:
import { init } from '@damonware/zip';
await init();1.2.0
2 years ago
1.1.5
2 years ago
1.2.1
2 years ago
1.1.4
2 years ago
1.1.3
2 years ago
1.1.2
2 years ago
1.1.1
2 years ago
1.1.0
2 years ago
1.0.10
2 years ago
1.0.9
2 years ago
1.0.8
2 years ago
1.0.7
2 years ago
1.0.6
2 years ago
1.0.5
2 years ago
1.0.4
2 years ago
1.0.3
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago