https://github.com/nasso/wazip
A ZIP file manipulation library for JavaScript powered by WASM
https://github.com/nasso/wazip
javascript wasm zip
Last synced: about 1 month ago
JSON representation
A ZIP file manipulation library for JavaScript powered by WASM
- Host: GitHub
- URL: https://github.com/nasso/wazip
- Owner: nasso
- License: apache-2.0
- Created: 2021-08-12T00:42:16.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-08-12T03:36:22.000Z (almost 5 years ago)
- Last Synced: 2025-11-29T12:15:33.415Z (7 months ago)
- Topics: javascript, wasm, zip
- Language: Rust
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE-2.0
Awesome Lists containing this project
README
# wazip
[](https://github.com/nasso/wazip/actions/workflows/rust.yml)
`wazip` is a ZIP file manipulation library for JavaScript powered by WebAssembly
and written in Rust.
## Usage
```ts
import { ZipWriter } from "wazip";
import { saveAs } from "file-saver";
async function main() {
// Create a new ZipWriter to create a new archive
let writer = new ZipWriter();
// You can optionally set the ZIP comment for the archive
writer.set_comment("a nice message!");
// Add a new file with `start_file`
writer.start_file("foo.txt");
// Write data to the current file (foo.txt)
// ZipWriter.write() takes an array or typed-array. strings must be encoded
writer.write(new TextEncoder().encode("hello world!"));
// When you're done, call writer.finish() and you get a Uint8Array (the ZIP)
let zip_data = writer.finish();
// This example uses file-saver to download the generated ZIP file
saveAs(new Blob([zip_data], { type: "application/zip" }), "bar.zip");
}
main();
```
## Features
| Feature | Status |
| ------------------------------ | ---------------------------- |
| Create an archive from scratch | :white_check_mark: Supported |
| Read an existing archive | :construction: Planned |
| Modify an archive | :construction: Planned |
Currently only DEFLATE is supported, but support for uncompressed storage is
planned. Other compression methods might be added if they can be ported to WASM.
## License
`wazip` is licensed under the terms of both the MIT license and the Apache
License (Version 2.0), at your choice.
See LICENSE-MIT and LICENSE-APACHE-2.0 files for the full texts.