You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14Lines changed: 14 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -99,6 +99,20 @@ const wasi = new WASI({
99
99
});
100
100
```
101
101
102
+
By default, the `stdout` and `stderr` handlers are passed strings. You can pass `outputBuffers: true` to get `Uint8Array` buffers instead. Along with that, you can also pass `Uint8Array` buffers to `stdin`.
103
+
104
+
```js
105
+
import { WASI, useStdio } from"uwasi";
106
+
constwasi=newWASI({
107
+
features: [useStdio({
108
+
outputBuffers:true,
109
+
stdin: () =>newUint8Array([1, 2, 3, 4, 5]),
110
+
stdout: (buf) =>console.log(buf),
111
+
stderr: (buf) =>console.error(buf),
112
+
})],
113
+
});
114
+
```
115
+
102
116
## Implementation Status
103
117
104
118
Some of WASI system calls are not implemented yet. Contributions are welcome!
0 commit comments