wasmfmt
A tool for formatting .wat
code.
Available as a command-line tool and a library.
For more information on how to use the library, see the API docs.
Install
To get wasmfmt
, you have two options:
- Download a prebuilt binary from the releases page. Binaries are distributed for the following platforms:
- Linux (x86_64 and ARM64, GNU and musl)
- MacOS (x86_64 and ARM64)
- Windows (x86_64 and ARM64)
- Build the tool manually, either from crates.io or directly from this repository.
To install from crates.io:
To install from source:
Use
To format a file in-place, use wasmfmt fix
:
To determine if a file is formatted properly, use wasmfmt check
:
To simply see the formatted version of a file, use wasmfmt print
:
For more information on how to use the tool, use wasmfmt help
:
Build
To build the binary, use Cargo:
The generated binary is located in target/release/wasmfmt
.
Test
To run the tests, use Cargo:
License
wasmfmt
is distributed under the terms of the MIT license. See LICENSE for details.