111 releases (25 breaking)

new 0.223.0 Jan 8, 2025
0.222.0 Dec 18, 2024
0.221.2 Dec 2, 2024
0.221.0 Nov 27, 2024
0.2.0 Nov 18, 2019

#17 in WebAssembly

Download history 63635/week @ 2024-09-22 63129/week @ 2024-09-29 75286/week @ 2024-10-06 64059/week @ 2024-10-13 76172/week @ 2024-10-20 81031/week @ 2024-10-27 81624/week @ 2024-11-03 75957/week @ 2024-11-10 87179/week @ 2024-11-17 79526/week @ 2024-11-24 97573/week @ 2024-12-01 93584/week @ 2024-12-08 91743/week @ 2024-12-15 51267/week @ 2024-12-22 42883/week @ 2024-12-29 82360/week @ 2025-01-05

274,243 downloads per month
Used in 282 crates (55 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