File tree Expand file tree Collapse file tree 2 files changed +4
-9
lines changed
packages/npm-packages/ruby-wasm-wasi/example Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change 2
2
3
3
This is a simple example of how to use the ` ruby-wasm-wasi ` faimily packages
4
4
5
- ## How to build
6
-
7
- ``` console
8
- $ npm install
9
- ```
10
-
11
5
## For browser
12
6
13
7
``` console
@@ -18,5 +12,6 @@ $ # Open http://localhost:8000/index.html
18
12
## For Node.js
19
13
20
14
``` console
21
- $ node --experimental-wasi-unstable-preview1 dist/index.node.js
15
+ $ npm install
16
+ $ node --experimental-wasi-unstable-preview1 index.node.js
22
17
```
Original file line number Diff line number Diff line change 1
1
import fs from "fs/promises" ;
2
- import { DefaultRubyVM } from "ruby-head-wasm-wasi/dist/node.esm " ;
2
+ import { DefaultRubyVM } from "ruby-head-wasm-wasi/dist/node.cjs.js " ;
3
3
4
4
// $ node --experimental-wasi-unstable-preview1 index.node.js
5
5
6
6
const main = async ( ) => {
7
7
const binary = await fs . readFile (
8
- "./node_modules/ruby-head-wasm-wasi/bin /ruby.wasm"
8
+ "./node_modules/ruby-head-wasm-wasi/dist /ruby.wasm"
9
9
) ;
10
10
const module = await WebAssembly . compile ( binary ) ;
11
11
const { vm } = await DefaultRubyVM ( module ) ;
You can’t perform that action at this time.
0 commit comments