Tested with Node 20.12.1, Bun 1.1.8, Deno 1.43.3, php-wasm v0.0.8.
- 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-php-wasm
- Install php-wasm:
yarn add php-wasm
- 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 a 4.5M-sized wasm file 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 httpget.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.