#zip #zip-archive #extension #file #convert #extract #crx

bin+lib uncrx-rs

Uncrx is a library that helps you convert a CRX Extension to a zip file that can be easily extracted

5 releases

0.2.2 Jan 27, 2024
0.2.0 Jan 26, 2024
0.1.2 Jan 14, 2024
0.1.1 Jan 14, 2024
0.1.0 Jan 14, 2024

#181 in Compression

Download history 7/week @ 2024-01-22 1/week @ 2024-02-19 15/week @ 2024-02-26 8/week @ 2024-03-11 16/week @ 2024-04-01 130/week @ 2024-04-15

146 downloads per month

MIT license

13KB
186 lines

Uncrx-rs

License Crates.io Version

Description

Uncrx is a library that helps you convert a CRX Extension to a zip file that can be easily extracted.

Table of Contents

Installation

cargo add uncrx-rs

Usage

// Open the CRX extension
let current_dir = env::current_dir().expect("Failed to get current directory");
let file_path = current_dir.join("src/mock/test-extension.crx");
let data = fs::read(file_path.to_str().unwrap()).expect("Failed to read file");

// Parse the extension
let extension = parse_crx(&data).expect("Failed to parse crx");

// Eventually save the zip section into a separate file for later extraction
let output_file = current_dir.join("out/extension.zip");
fs::write(output_file, &extension.zip).expect("Failed to write file");

Contributing

Feel free to open issues and send PRs. We will evaluate them together in the comment section.

License

This project is licensed under the MIT License.

Dependencies

~1.3–2MB
~36K SLoC