suborbital / javy

JS to WebAssembly toolchain
Apache License 2.0
10 stars 2 forks source link

Javy: A Jav aScript to WebAssembl y toolchain

Build status

About this repo | How to use this repo

About 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.

Contributing

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.

Build

Development

Building

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.

Compiling to WebAssembly

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

Reactr Examples

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.