watInterpreter can parse and execute wat (text representaion of wasm) files. This project is mainly just for fun.
there is included polyfill for an es5 conversion with babel compiler
Goto here to compile some code :) https://webassembly.studio/
var watInterpreter = require('./watInterpreter.js'),
fs = require('fs'),
file = fs.readFileSync('input/read.wat', 'utf8'),
_module = new watInterpreter().Module(file, {imports: {
printMessage(arr, string){
console.log(arr, string)
}
}});
console.log(_module);
watInterpreter also includes certain type expantion.
Such as the vec_str
and vec_arr
instructions.