(module (func $addTwo (param i32 i32) (result i32) (i32.add (get_local 0) (get_local 1))) (export "addTwo" $addTwo))
fetch('test.wasm') .then(response => response.arrayBuffer()) .then(bytes => WebAssembly.compile(bytes)) .then(compiled => new WebAssembly.Instance(compiled, null)) .then(instance => { console.log(instance.exports.addTwo(41, 1)); });