Registry / build-tool / wasm-opt

wasm-opt

JSON →
library0.116.1rscratesunverified

Bindings to the wasm-opt tool for optimizing WebAssembly modules.

# Cargo.toml [dependencies] wasm-opt = "0.116.1"
INSTALL
IMPORT
SIG · WASM-OPT
W
wasm-opt
build-toolrustv0.116.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

OptimizationOptions
use wasm_opt::OptimizationOptions;

Optimizes a WebAssembly module using wasm-opt.

use wasm_opt::OptimizationOptions; fn main() { let options = OptimizationOptions::new_opt_level_2(); let wasm = wat::parse_str("(module)").unwrap(); let result = options.run(&wasm).unwrap(); println!("Optimized {} bytes", result.len()); }
Debug
Known issues
gotchaRequires the `wasm-opt` binary to be installed separately.
fix
Install wasm-opt via `npm install -g wasm-opt` or download from binaryen.
affects: >=0.116.0
Upgrade
Version history
0.116.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
42 hits · last 30 days
node
38
OpenAI (training)
1
Resources
wasm-opt — cargo add wasm-opt · libregistry