About this repo | How to use this repo
Introduction: Run your JavaScript on WebAssembly. Javy takes your JavaScript code, and executes it in a WebAssebmly embedded JavaScript runtime.
Javy is currently used for the beta Shopify Scripts platform. We intend on supporting and improving this runtime in that context. Eventually this project should be a good general purpose JavaScript runtime but that is not the current goal.
Javy is a beta project and will be under major development. We welcome feedback, bug reports and bug fixes. We're also happy to discuss feature development but please discuss the features in an issue before contributing. All contributors will be prompted to sign our CLA.
rustup target add wasm32-wasi
cargo install wasmtime-cli
(required for
cargo-wasi
)cargo install cargo-wasi
After all the dependencies are installed, run make
. You
should now have access to the executable in target/release/javy
Alternatively you can run make && cargo install --path crates/cli
.
After running the previous command you'll have a global installation of the
executable.
You can create a WebAssembly binary from JavaScript by:
javy index.js -o destination/index.wasm
For more information on the commands you can run javy --help
You can check out the examples in the examples
directory. After running the steps above and having javy
on your PATH, cd
to any example folder and run npm install && npm run build
to build a Reactr-compatible wasm file.