88 releases (8 breaking)

new 0.206.0 Apr 25, 2024
0.204.0 Apr 16, 2024
0.202.0 Mar 26, 2024
0.2.75 Nov 29, 2023
0.2.0 Nov 18, 2019

#5 in WebAssembly

Download history 33718/week @ 2024-01-10 39837/week @ 2024-01-17 40044/week @ 2024-01-24 39947/week @ 2024-01-31 36371/week @ 2024-02-07 36632/week @ 2024-02-14 40762/week @ 2024-02-21 45422/week @ 2024-02-28 46147/week @ 2024-03-06 48265/week @ 2024-03-13 53016/week @ 2024-03-20 45674/week @ 2024-03-27 53247/week @ 2024-04-03 50010/week @ 2024-04-10 55527/week @ 2024-04-17 47820/week @ 2024-04-24

216,637 downloads per month
Used in 184 crates (43 directly)

Apache-2.0 WITH LLVM-exception

1MB
24K SLoC

wasmprinter

A Bytecode Alliance project

A Rust parser for printing a WebAssembly binary in the WebAssembly Text Format (WAT).

Crates.io version Download docs.rs docs

Usage

Add wasmprinter to your Cargo.toml

$ cargo add wasmprinter

You can then convert wasm binaries to strings like so:

fn main() -> Result<()> {
    let foo_wat = wasmprinter::print_file("path/to/foo.wasm")?;

    let binary = /* ... */;
    let wat = wasmprinter::print_bytes(&binary)?;

    // ...
}

License

This project is licensed under the Apache 2.0 license with the LLVM exception. See LICENSE for more details.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.

Dependencies

~2MB
~33K SLoC