Tested with Node 20.17.0, Bun 1.1.29, Deno 1.46.3, WAForth v0.20.1.
- Open this repo in devcontainer, e.g. using Github Codespaces. Type or copy/paste following commands to devcontainer's terminal.
cd
into the folder of this example:
cd browser-and-node
- Install WAForth library:
yarn add waforth
- 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
and JS files (containing bundled WASM in base64 form) are loaded into browser, refer to browser developer console to see the results.
- Run with Node:
node httpget.mjs
- Install Bun:
curl -fsSL https://bun.sh/install | bash
- Run with Bun:
~/.bun/bin/bun bun.mjs
- Install Deno:
curl -fsSL https://deno.land/x/install/install.sh | sh
- Run with Deno:
~/.deno/bin/deno run --allow-read --allow-net httpget.mjs
Perform your own experiments if desired.