https://github.com/novqigarrix/zip-wasm
A WebAssembly module for handling ZIP file operations in the browser, built with Rust and wasm-bindgen.
https://github.com/novqigarrix/zip-wasm
web-assembly zip
Last synced: 14 days ago
JSON representation
A WebAssembly module for handling ZIP file operations in the browser, built with Rust and wasm-bindgen.
- Host: GitHub
- URL: https://github.com/novqigarrix/zip-wasm
- Owner: NovqiGarrix
- Created: 2025-02-03T17:45:08.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-02-03T18:01:30.000Z (over 1 year ago)
- Last Synced: 2025-02-03T18:50:13.456Z (over 1 year ago)
- Topics: web-assembly, zip
- Language: Rust
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# zip-wasm
A WebAssembly module for handling ZIP file operations in the browser, built with Rust and wasm-bindgen.
## Features
- 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
## Prerequisites
Before you begin, ensure you have the following installed:
- [Rust](https://www.rust-lang.org/tools/install)
- [wasm-pack](https://rustwasm.github.io/wasm-pack/installer/)
## Installation
1. Clone the repository:
```bash
git clone https://github.com/NovqiGarrix/zip-wasm.git
cd zip-wasm
```
2. Build the WebAssembly module:
```bash
wasm-pack build --target web
```
## Usage
1. Usage in Deno:
```typescript
// 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);
```
2. Or you can open the index.html file in your browser and try it yourelf.
## Development
1. Make changes to the Rust code in `src/lib.rs`
2. Rebuild the WebAssembly module:
```bash
wasm-pack build --target web
```
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.