A WebAssembly module for handling ZIP file operations in the browser, built with Rust and wasm-bindgen.
- Perform ZIP file operations directly in the browser
- Built with Rust for performance and safety
- WebAssembly integration for native-like speed
- Zero dependencies on server-side processing
Before you begin, ensure you have the following installed:
- Clone the repository:
git clone https://github.com/NovqiGarrix/zip-wasm.git
cd zip-wasm
- Build the WebAssembly module:
wasm-pack build --target web
- Usage in Deno:
// examples/deno/main.ts
import fs from 'node:fs/promises';
import init, { compress_files_to_zip } from '../../pkg/zip_wasm.js';
await init();
const files = [
{
name: 'hello.txt',
content: new TextEncoder().encode('hello world'),
},
{
name: 'hello2.txt',
content: new TextEncoder().encode('hello world 2'),
},
];
const compressedZip = await compress_files_to_zip(files);
await fs.writeFile('hello.zip', compressedZip);
- Or you can open the index.html file in your browser and try it yourelf.
- Make changes to the Rust code in
src/lib.rs
- Rebuild the WebAssembly module:
wasm-pack build --target web
Contributions are welcome! Please feel free to submit a Pull Request.