Skip to content

A WebAssembly module for handling ZIP file operations in the browser, built with Rust and wasm-bindgen.

Notifications You must be signed in to change notification settings

NovqiGarrix/zip-wasm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

Installation

  1. Clone the repository:
git clone https://github.com/NovqiGarrix/zip-wasm.git
cd zip-wasm
  1. Build the WebAssembly module:
wasm-pack build --target web

Usage

  1. 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);
  1. 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:
wasm-pack build --target web

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

About

A WebAssembly module for handling ZIP file operations in the browser, built with Rust and wasm-bindgen.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages