122 releases (27 breaking)

0.225.0 Feb 4, 2025
0.224.0 Jan 22, 2025
0.222.0 Dec 18, 2024
0.221.0 Nov 27, 2024
0.2.0 Nov 18, 2019

#12 in WebAssembly

Download history 78823/week @ 2024-10-25 81439/week @ 2024-11-01 75985/week @ 2024-11-08 86677/week @ 2024-11-15 79789/week @ 2024-11-22 96385/week @ 2024-11-29 93046/week @ 2024-12-06 85622/week @ 2024-12-13 66234/week @ 2024-12-20 41434/week @ 2024-12-27 80911/week @ 2025-01-03 93866/week @ 2025-01-10 80672/week @ 2025-01-17 92711/week @ 2025-01-24 102902/week @ 2025-01-31 98846/week @ 2025-02-07

391,717 downloads per month
Used in 293 crates (56 directly)

Apache-2.0…

1.5MB
32K 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–7.5MB
~52K SLoC