WASM-TOOLS-JSON-FROM-WAST(1)
π 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*.wastfile 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:-vis info,-vvis debug,-vvvis 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
- ubuntu stonking: wasm-tools 1.239.0+ds-10 Β· Apache-2.0 OR Apache-2.0 WITH LLVM exception OR MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms