85 releases (5 breaking)

new 0.203.0 Apr 12, 2024
0.202.0 Mar 26, 2024
0.201.0 Feb 27, 2024
0.2.75 Nov 29, 2023
0.2.0 Nov 18, 2019

#2 in #binary-format

Download history 14147/week @ 2023-12-23 20821/week @ 2023-12-30 32550/week @ 2024-01-06 37774/week @ 2024-01-13 39723/week @ 2024-01-20 39502/week @ 2024-01-27 39005/week @ 2024-02-03 35780/week @ 2024-02-10 40287/week @ 2024-02-17 42264/week @ 2024-02-24 45880/week @ 2024-03-02 46434/week @ 2024-03-09 53564/week @ 2024-03-16 46380/week @ 2024-03-23 51004/week @ 2024-03-30 40633/week @ 2024-04-06

198,388 downloads per month
Used in 169 crates (36 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

~1MB
~20K SLoC