WASM-TOOLS-JSON-FROM-WAST(1)

πŸ“¦ version 1.239.0, in ubuntu stonking

πŸ’– wasm-tools json-from-wast πŸ’–

okay bestie, welcome to wasm-tools json-from-wast, part of wasm-tools version 1.239.0 β€” yes the manual calls it WA...S(JSON-FROM-WAST), we don't ask questions πŸ’…


NAME

wasm-tools json-from-wast β€” turn a *.wast WebAssembly spec test into a *.json file and a bunch of *.wasm files. it's giving converter energy πŸ¦‹


SYNOPSIS

wasm-tools json-from-wast [OPTIONS] <WAST>

DESCRIPTION

so basically ✨ this subcommand takes a WebAssembly spec test in the *.wast format, parses it, and then emits both a JSON file and a number of auxiliary modules. iconic, honestly.

the whole point? it does all the parsing for the various implementations of the wasm text format while deferring the actual processing of all commands. so you get the parse now, you do the thing later. main character scheduling tbh πŸŽ€

this subcommand is modelled after WABT's wast2json tool, which lives at https://github.com/WebAssembly/wabt. there's more documentation of the format over at https://github.com/WebAssembly/wabt/blob/main/docs/wast2json.md if you wanna go read it. iykyk πŸ“š

heads up bestie: this subcommand does not output precisely the same output as wast2json β€” but there should be no major discrepancies. so like, vibe-compatible, not clone-compatible 🌸

it will also emit a number of *.wasm and *.wat files in the current directory (or in --wasm-dir if you said so) which the JSON will reference. and it prints the JSON to stdout unless you gave it the -o flag. periodt.

Arguments:

  • <WAST> β€” the input *.wast file that will be parsed and converted to JSON. that's the one you're feeding it πŸ“

✨ OPTIONS ✨

  • -v, --verbose... β€” use verbose output. the more v's the more you see: -v is info, -vv is debug, -vvv is trace. turn the volume all the way up πŸ”₯
  • --color <COLOR> β€” configuration over whether terminal colors are used in output.

supports one of auto|never|always|always-ansi. the default is to detect what to do based on the terminal environment, for example by using isatty.

[default: auto]

  • -o, --output <OUTPUT> β€” where to place output.

if not provided then stdout is used.

  • --wasm-dir <WASM_DIR> β€” where to place binary and text WebAssembly files referenced by tests.

defaults to the current directory.

  • --pretty β€” output pretty-printed JSON instead of compact json. give that JSON room to breathe πŸ’…
  • --allow-confusing-unicode <true|false> β€” controls the "allow confusing unicode" option, which will reject parsing files that have unusual characters. dramatic but fair.

this is defaulted to true to enable parsing all upstream spec tests, but it can be disabled if desired too.

[possible values: true, false]

  • -h, --help β€” print help (see a summary with -h). your little cheat sheet 🫢

no cap, that's the whole page. every flag, every default, every value, all accounted for πŸ’–

and that's a wrap bestie!! 🌈 this was wasm-tools json-from-wast in the wasm-tools manual, page 1, dated August 2026, running version 1.239.0. go forth and convert those *.wast files, you absolute legend πŸ‘‘βœ¨

πŸ“¦ where this page comes from