bjorn3 commented on Issue #161:
I think this can be closed. It isn't related to Cranelift or Wasmtime.
cfallin closed Issue #161:
I'd like to expand the tutorial on how to run the wasm file in NodeJS after running it with wasmtime.
Normally you can simply run
WebAssembly.instantiate(buf)
, but here the demo.c contains arguments input.txt and output.txt.
The WebAssembly requires awasi_unstable
object and within that afd_prestat_get
function, but I don't know how it should look like...
index.js
const fs = require('fs'); const buf = fs.readFileSync('./demo.wasm'); (async () => { const res = await WebAssembly.instantiate(buf, {wasi_unstable: {fd_prestat_get: () => {}}}); console.log(res.instance); })();
Last updated: Nov 22 2024 at 16:03 UTC