The WebAssembly Binary Toolkit

Public Library1.0.37updated 4 days ago967.71 KB
COPY
wapm install wasmer/wabt

Need help using WAPM?

Get started here

Commands

wat2wasm
wast2json
wasm2wat
wasm-interp
wasm-validate
wasm-strip

Files

  • Readme.md

WABT: The WebAssembly Binary Toolkit

wabt includes the following commands:

  • wat2wasm
  • wasm2wat
  • wast2json
  • wasm-validate
  • wasm-strip

Commands

wat2wasm

Translate from WebAssembly text format to the WebAssembly binary format.

# parse and typecheck test.wat
wat2wasm test.wat

# parse test.wat and write to binary file test.wasm
wat2wasm test.wat -o test.wasm

# parse spec-test.wast, and write verbose output to stdout (including the
# meaning of every byte)
wat2wasm spec-test.wast -v

wasm2wat

The inverse of wat2wasm, translate from the binary format back to the text format (also known as a .wat).

# parse and typecheck test.wat
wat2wasm test.wat

# parse test.wat and write to binary file test.wasm
wat2wasm test.wat -o test.wasm

# parse spec-test.wast, and write verbose output to stdout (including the
# meaning of every byte)
wat2wasm spec-test.wast -v

wasm-validate

Validate a file in the WebAssembly binary format

# Validates the WebAssembly file
wasm-validate test.wasm

wasm-strip

Remove sections of a WebAssembly binary file

# Validates the WebAssembly file
wasm-strip test.wasm

wast2json

wast2json converts a file in the wasm spec test format to a JSON file and associated wasm binary files

# parse spec-test.wast, and write files to spec-test.json. Modules are written
# to spec-test.0.wasm, spec-test.1.wasm, etc.
wast2json spec-test.wast -o spec-test.json

Building from Source

  1. Run ./scripts/build_wasi.sh

<1klast week

Latest version

1.0.37

Latest updated

4 days ago

Unpackaged size

967.71 KB

Collaborators

    Run it in the browser