106 releases (22 breaking)

new 0.220.0 Nov 12, 2024
0.218.0 Sep 30, 2024
0.215.0 Jul 31, 2024
0.202.0 Mar 26, 2024
0.2.0 Nov 18, 2019

#15 in WebAssembly

Download history 65950/week @ 2024-07-29 57356/week @ 2024-08-05 61999/week @ 2024-08-12 65830/week @ 2024-08-19 61460/week @ 2024-08-26 62280/week @ 2024-09-02 65593/week @ 2024-09-09 64048/week @ 2024-09-16 63800/week @ 2024-09-23 64791/week @ 2024-09-30 72906/week @ 2024-10-07 63967/week @ 2024-10-14 77477/week @ 2024-10-21 80077/week @ 2024-10-28 82756/week @ 2024-11-04 75743/week @ 2024-11-11

319,882 downloads per month
Used in 266 crates (53 directly)

Apache-2.0…

1.5MB
31K 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

~1–8MB
~56K SLoC