109 releases (23 breaking)

new 0.221.2 Dec 2, 2024
0.221.0 Nov 27, 2024
0.215.0 Jul 31, 2024
0.202.0 Mar 26, 2024
0.2.0 Nov 18, 2019

#17 in WebAssembly

Download history 65752/week @ 2024-08-17 58726/week @ 2024-08-24 64686/week @ 2024-08-31 64534/week @ 2024-09-07 65329/week @ 2024-09-14 63030/week @ 2024-09-21 63920/week @ 2024-09-28 75740/week @ 2024-10-05 63849/week @ 2024-10-12 75643/week @ 2024-10-19 80230/week @ 2024-10-26 81179/week @ 2024-11-02 75575/week @ 2024-11-09 88635/week @ 2024-11-16 77288/week @ 2024-11-23 100335/week @ 2024-11-30

355,163 downloads per month
Used in 273 crates (54 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–7.5MB
~55K SLoC