This example uses binary build of Wasmoon
-
Open this repo in devcontainer, e.g. using Github Codespaces. Type or copy/paste following commands to devcontainer's terminal.
-
cd
into this example's folder:
cd browser-and-node
- Install Wasmoon using
npm
:
npm install wasmoon
node src/httpget.mjs
Optionally you can also test with Deno.
- Install Deno:
curl -fsSL https://deno.land/x/install/install.sh | sh
- Perform the test:
~/.deno/bin/deno run --allow-read --allow-net src/httpget.mjs
- Install
webpack
:
npm install webpack-cli
- Run
webpack
to build a web bundle:
npx webpack
This creates a dist
folder with 100k JS bundle main.js
inside it.
- Run simple HTTP server to temporarily publish project to Web:
python3 -m http.server
Codespace will show you "Open in Browser" button. Just click that button or obtain web address from "Forwarded Ports" tab.
- As
index.html
loaded into browser, refer to browser developer console to see the results.
Perform your own experiments if desired.