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_unstableobject and within that afd_prestat_getfunction, but I don't know how it should look like...
index.jsconst 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: Dec 06 2025 at 06:05 UTC