|0.1.16||Jan 25, 2023|
|0.1.12||Nov 21, 2022|
|0.1.6||Jul 27, 2022|
|0.1.1||Feb 17, 2022|
#1362 in WebAssembly
79 downloads per month
A Bytecode Alliance project
Rust tooling for low-level manipulation of WebAssembly modules
This project can be installed and compiled from source with this Cargo command:
$ cargo install wasm-tools
Additionally there are precompiled artifacts built on CI which are available for download as well.
Installation can be confirmed with:
$ wasm-tools --version
Subcommands can be explored with:
$ wasm-tools help
wasm-tools binary internally contains a number of subcommands for working
with wasm modules. Many subcommands also come with Rust crates that can be use
programmatically as well:
||wasmparser||Validate a WebAssembly file|
||wat and wast||Translate the WebAssembly text format to binary|
||wasmprinter||Translate the WebAssembly binary format to text|
||wasm-smith||Generate a "random" valid WebAssembly module|
||wasm-mutate||Mutate an input wasm file into a new valid wasm file|
||wasm-shrink||Shrink a wasm file while preserving a predicate|
||Print debugging information about the binary format|
||Print debugging information about section headers|
||Remove custom sections from a WebAssembly file|
||Demangle Rust and C++ symbol names in the
||wasm-compose||Compose wasm components together|
||wit-component||Create a component from a core wasm binary|
||wasm-metadata||Show name and producer metadata in a component or module|
||Add name or producer metadata to a component or module|
||Translate wasm offsets to filename/line numbers with DWARF|
wasm-tools CLI is primarily intended to be a debugging aid. The various
subcommands all have
--help explainer texts to describe more about their
functionality as well.
As mentioned above many of the tools of the
wasm-tools CLI have libraries
implemented in this repository as well. These libraries are:
wasmparser- a library to parse WebAssembly binaries
wat- a library to parse the WebAssembly text format
wat, except provides an AST
wasmprinter- prints WebAssembly binaries in their string form
wasm-mutate- a WebAssembly test case mutator
wasm-shrink- a WebAssembly test case shrinker
wasm-smith- a WebAssembly test case generator
wasm-encoder- a crate to generate a binary WebAssembly module
wit-parser- a crate to parse and manage
*.witfiles and interfaces.
wit-component- a crate to create components from core wasm modules.
wasm-metadata- a crate to manipulate name and producer metadata (custom sections) in a wasm module or component.
It's recommended to use the libraries directly rather than the CLI tooling when embedding into a separate project.
wasm-tools can be used from the
This project is licensed under the Apache 2.0 license with the LLVM exception. See LICENSE for more details.
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.