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.
-
cdinto this example's folder:
cd browser-and-node- Install Wasmoon using
npm:
npm install wasmoonnode src/httpget.mjsOptionally 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
webpackto build a web bundle:
npx webpackThis 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.serverCodespace will show you "Open in Browser" button. Just click that button or obtain web address from "Forwarded Ports" tab.
- As
index.htmlloaded into browser, refer to browser developer console to see the results.
Perform your own experiments if desired.