wasmfmt

Crates.iowasmfmt
lib.rswasmfmt
version0.2.4
sourcesrc
created_at2021-01-31 23:28:20.160534
updated_at2022-08-22 11:53:26.49541
descriptionA WebAssembly formatter
homepagehttps://github.com/philipahlberg/wasmfmt
repositoryhttps://github.com/philipahlberg/wasmfmt
max_upload_size
id349046
size155,943
Philip Ahlberg (philipahlberg)

documentation

https://docs.rs/wasmfmt

README

wasmfmt

crates.io version crates.io downloads

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:

  1. 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)
  2. Build the tool manually, either from crates.io or directly from this repository.

To install from crates.io:

cargo install wasmfmt

To install from source:

cargo install --path /path/to/wasmfmt

Use

To format a file in-place, use wasmfmt fix:

wasmfmt fix /path/to/file.wat

To determine if a file is formatted properly, use wasmfmt check:

wasmfmt check /path/to/file.wat

To simply see the formatted version of a file, use wasmfmt print:

wasmfmt print /path/to/file.wat

For more information on how to use the tool, use wasmfmt help:

wasmfmt help

Build

To build the binary, use Cargo:

cargo build --release

The generated binary is located in target/release/wasmfmt.

Test

To run the tests, use Cargo:

cargo test

License

wasmfmt is distributed under the terms of the MIT license. See LICENSE for details.

Commit count: 83

cargo fmt