Official JS modules for Edge Python exposing host APIs (DOM, network, storage and more) to Python scripts. Each capability is a plain ESM registered with createWorker via mainThreadModules, no .wasm, no Rust, no custom embedder.
├── dom
│ └── src
│ ├── index.js
│ └── main
├── network
│ └── src
│ ├── index.js
│ └── main
├── storage
│ └── src
│ ├── index.js
│ └── main
├── time
│ └── src
│ ├── index.js
│ └── main
└── tests
One folder per capability. Each ships a <name>/<name>.json corpus; the shared runner in tests/ walks for them and drives every case through headless Chromium.
<script type="module">
import { createWorker } from "https://cdn.edgepython.com/runtime/src/index.js";
import { dom } from "./dom/src/index.js";
const worker = await createWorker({
wasmUrl: "https://cdn.edgepython.com/compiler.wasm",
mainThreadModules: { dom },
});
await worker.run(await (await fetch("./script.py")).text());
</script>| Folder | Description |
|---|---|
dom |
Browser DOM access, see dom/README.md |
network |
HTTP fetch, WebSocket, SEE, see network/README.md |
storage |
localStorage, sessionStorage, IndexedDB, see storage/README.md |
time |
Clocks, sleep, calendar formatting, see time/README.md |
Requires Deno v2 and Playwright's Chromium.
# Lint one capability
cd host/<capability> && deno lint src/
# Install Chromium (once)
deno run -A npm:playwright install --with-deps chromium
# Test one capability (from host/)
cd host && HOSTCAP=<capability> deno test --allow-all tests/<capability> is one of dom, network, storage, time.
MIT OR Apache-2.0