const repl = require("repl"); const fs = require("fs"); async function main() { const { instance: main_instance } = await WebAssembly.instantiate( fs.readFileSync("test_main.wasm") ); const { instance: side_instance } = await WebAssembly.instantiate( fs.readFileSync("test_side.wasm"), { env: { wasm_split_table: main_instance.exports.wasm_split_table } } ); console.log( "main_instance.exports.doubleadd(10, 3) == 26? ", main_instance.exports.doubleadd(10, 3) == 26 ); console.log( "side_instance.exports.doublesubtractaddone(10, 3) == 15? ", side_instance.exports.doublesubtractaddone(10, 3) == 15 ); const cli = repl.start(); Object.assign(cli.context, { main_instance, side_instance }); } main();