Skip to content

WebAssembly Text to binary WASM module tools. This tool provides a CLI built on top of WebAssembly Binary Toolkit and binaryen.js.

Notifications You must be signed in to change notification settings

battlelinegames/wat-wasm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wat-wasm

wat-wasm is a tool for converting WebAssembly Text to optimized binary WebAssembly and back. It has a version of wat2wasm and wasm2wat included. You can use wat2wasm with -O optimization flags with wat2wasm, or even direclty on the binary with wat-wasm CLI. This is built on top of WABT.js and Binaryen.js.

Question? Contact me on twitter: @battagline

More tutorials on Wasm Book

Install:

npm install wat-wasm -g

Usage:

wat-wasm file.wat
Creates a WASM file given a wat file

wat-wasm file.wat -o watfile.wasm
Creates a WASM file given a WebAssembly Text file.
The -o flag allows you to specify an output file.

wat-wasm file.wasm -o watfile.wat
Creates a watfile.wat WebAssembly Text file.
The -o flag allows you to specify an output file.

watwasm file.wat
Creates a WASM file given a wat file

watwasm file.wat -o watfile.wasm
Creates a WASM file given a WebAssembly Text file.
The -o flag allows you to specify an output file.

watwasm file.wasm -o watfile.wat
Creates a watfile.wat WebAssembly Text file.
The -o flag allows you to specify an output file.

wat2wasm file.wat
wat2wasm does the same thing as watwasm, but
the input file must be WAT

wasm2wat file.wasm
wasm2wat does the same thing as watwasm, but
the input file must be WASM

Flags:

-o is followed by an output file name

-O1 minimal performance optmization
-O2 moderate performance optmization
-O3 maximum performance optmization

-Os minimal size optmization
-Oz maximum size optmization

For help please contact:

Rick Battagline
[email protected]
Twitter: @battagline

WebAssembly Book

About

WebAssembly Text to binary WASM module tools. This tool provides a CLI built on top of WebAssembly Binary Toolkit and binaryen.js.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published