Bare minimum util to import and use wasm in node 🚤
This is still work in progress.
yarn add node-wasm
import loadWasm from 'node-wasm';
async function run() {
const {rust_function} = await loadWasm('/local/path/to/wasm');
const result = rust_function();
console.log(result);
}
run();
Check the node example for a simple demo.
The corresponding rust example is also available for you to play with.