0.1.0 • Published 3 years ago

@irongeek/binaryen v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

npm npm downloads GitHub issues GitHub release (latest by date) License

This package will download, compile, and install the WebAssembly Binaryen toolchain from https://github.com/WebAssembly/binaryen as NPM global executables

Prerequisites

Installation

npm install -g @irongeek/binaryen

📌 NOTE

Please give it some time to finish... 🙏

Depends on your computer specs, the installation process might take a while, and because NPM suppresses all output from custom install script (unless exception is thrown), the process might seems like it's stuck or hanging while it's actually busy compiling the binaries.

Included Tools

ToolsDescription
wasm-optLoads WebAssembly and runs Binaryen IR passes on it
wasm-asAssembles WebAssembly in text format (currently S-Expression format) into binary format (going through Binaryen IR)
wasm-disUn-assembles WebAssembly in binary format into text format (going through Binaryen IR)
wasm2jsA WebAssembly-to-JS compiler. This is used by Emscripten to generate JavaScript as an alternative to WebAssembly
wasm-reduceA testcase reducer for WebAssembly files. Given a wasm file that is interesting for some reason (say, it crashes a specific VM), wasm-reduce can find a smaller wasm file that has the same property, which is often easier to debug. See the docs for more details
wasm-shellA shell that can load and interpret WebAssembly code. It can also run the spec test suite
wasm-emscripten-finalizeTakes a wasm binary produced by llvm+lld and performs emscripten-specific passes over it
wasm-ctor-evalA tool that can execute C++ global constructors ahead of time. Used by Emscripten

Known Issues

Must be run under bourne shell (sh) compatible terminal.

May or may not work on Windows using Windows Subsystem for Linux.

Acknowledgement

Mathias Buus for the original webassembly-binary-toolkit installation script.

License

This package is released under the terms of The MIT License