This is an experimental SDK for building Spin apps using JavaScript (and TypeScript, etc.). It borrows heavily from Javy, using the same approach of providing a CLI utility to convert a JS file into a Wasm file. Ultimately we plan to package this as a Spin plugin which can be invoked from an NPM build script as the final step.
The top level directory contains an example HTTP trigger implemented using NPM, Webpack, etc. See src/index.js for details
- Make
- NPM
- Rust (including the wasm32-wasi target)
- WASI SDK installed at /opt/wasi-sdk
npm install --prefix crates/spin-js-engine/src/js_sdk
make
There are some examples provided in the example/
directory. Each example has a readme on building and running it.