Some checks failed
Release CLI / Pre-release build (push) Has been cancelled
Release CLI / Pre-release test (macos-12) (push) Has been cancelled
Release CLI / Pre-release test (ubuntu-22.04) (push) Has been cancelled
Release CLI / Pre-release test (windows-2022) (push) Has been cancelled
Release CLI / Release (push) Has been cancelled
https://go.dev/blog/go1.21 Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
wazero CLI
The wazero CLI can be used to execute a standalone WebAssembly binary.
Installation
$ go install github.com/tetratelabs/wazero/cmd/wazero@latest
Usage
The wazero CLI accepts a single argument, the path to a WebAssembly binary. Arguments can be passed to the WebAssembly binary itself after the path.
wazero run calc.wasm 1 + 2
In addition to arguments, the WebAssembly binary has access to stdout, stderr, and stdin.
Docker / Podman
wazero doesn't currently publish binaries, but you can make your own with our example Dockerfile. It should amount to about 4.5MB total.
# build the image
$ docker build -t wazero:latest -f Dockerfile .
# volume mount wasi or GOOS=js wasm you are interested in, and run it.
$ docker run -v $PWD/testdata/:/wasm wazero:latest /wasm/wasi_arg.wasm 1 2 3
wasi_arg.wasm123