#webassembly #binary

wasmprinter

Rust converter from the WebAssembly binary format to the text format

76 releases

new 0.2.75 Nov 29, 2023
0.2.71 Oct 30, 2023
0.2.62 Jul 26, 2023
0.2.54 Mar 10, 2023
0.2.0 Nov 18, 2019

#1116 in WebAssembly

Download history 22839/week @ 2023-08-14 26600/week @ 2023-08-21 26444/week @ 2023-08-28 25024/week @ 2023-09-04 26705/week @ 2023-09-11 29006/week @ 2023-09-18 23350/week @ 2023-09-25 25876/week @ 2023-10-02 20709/week @ 2023-10-09 25842/week @ 2023-10-16 29530/week @ 2023-10-23 36391/week @ 2023-10-30 35126/week @ 2023-11-06 31361/week @ 2023-11-13 28291/week @ 2023-11-20 30978/week @ 2023-11-27

128,058 downloads per month
Used in 78 crates (23 directly)

Apache-2.0 WITH LLVM-exception

1MB
22K 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

~1MB
~17K SLoC