#webassembly #parser #converter #bytecode #text #string #binary

wasmprinter

Rust converter from the WebAssembly binary format to the text format

50 releases

0.2.49 Jan 25, 2023
0.2.45 Dec 12, 2022
0.2.44 Nov 21, 2022
0.2.38 Jul 27, 2022
0.2.0 Nov 18, 2019

#38 in WebAssembly

Download history 4937/week @ 2022-10-14 6815/week @ 2022-10-21 6135/week @ 2022-10-28 5979/week @ 2022-11-04 6088/week @ 2022-11-11 4551/week @ 2022-11-18 3939/week @ 2022-11-25 3045/week @ 2022-12-02 4658/week @ 2022-12-09 3529/week @ 2022-12-16 1952/week @ 2022-12-23 3510/week @ 2022-12-30 4097/week @ 2023-01-06 7763/week @ 2023-01-13 7547/week @ 2023-01-20 6545/week @ 2023-01-27

26,533 downloads per month
Used in 24 crates (18 directly)

Apache-2.0 WITH LLVM-exception

785KB
17K 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

~2.5MB
~72K SLoC