https://github.com/oasislabs/wasi-runner
🏃♀️Runner for WASI modules
https://github.com/oasislabs/wasi-runner
nodejs wasi webassembly
Last synced: 3 months ago
JSON representation
🏃♀️Runner for WASI modules
- Host: GitHub
- URL: https://github.com/oasislabs/wasi-runner
- Owner: oasislabs
- License: other
- Created: 2019-05-06T17:53:47.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-05-01T01:40:22.000Z (over 2 years ago)
- Last Synced: 2025-04-02T11:36:21.375Z (9 months ago)
- Topics: nodejs, wasi, webassembly
- Language: C
- Homepage:
- Size: 889 KB
- Stars: 10
- Watchers: 24
- Forks: 2
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
WASI Runner
===
Module entrypoint for instantiation and execution of WASI-targeted
WASM code. A modification of the [js-polyfill](https://wasi.dev/polyfill/) for easier use in testing / command line interactions.
Usage
---
```
const runner = require('wasi-runner');
let stdin = 'hello world';
let exitCode = await runner.instantiate(fs.readFileSync('my_wasi.wasm'), {
stdin,
stdout: (val) => {
console.log(val);
},
});
```
Limitations
---
* The current structure won't safely support multiple concurrent instances.
* Mapping of stdin/stdout/stderr is fairly rudimentary.
* The shim provides default polyfill for socket and FD functionality.
* The runner doesn't (yet) allow for over-riding most of that defualt behavior.