Skip to content

Commit 0e636fa

Browse files
Update Node.js example project
1 parent b1343ab commit 0e636fa

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

packages/npm-packages/ruby-wasm-wasi/example/README.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22

33
This is a simple example of how to use the `ruby-wasm-wasi` faimily packages
44

5-
## How to build
6-
7-
```console
8-
$ npm install
9-
```
10-
115
## For browser
126

137
```console
@@ -18,5 +12,6 @@ $ # Open http://localhost:8000/index.html
1812
## For Node.js
1913

2014
```console
21-
$ node --experimental-wasi-unstable-preview1 dist/index.node.js
15+
$ npm install
16+
$ node --experimental-wasi-unstable-preview1 index.node.js
2217
```

packages/npm-packages/ruby-wasm-wasi/example/index.node.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
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";
33

44
// $ node --experimental-wasi-unstable-preview1 index.node.js
55

66
const main = async () => {
77
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"
99
);
1010
const module = await WebAssembly.compile(binary);
1111
const { vm } = await DefaultRubyVM(module);

0 commit comments

Comments
 (0)