Runs for real
Demos are ordinary functions. The terminal serialises each one, hands it to an isolated worker, and streams back everything it prints — including return values and thrown errors.
A terminal that runs real code in the page. Every demo is genuine JavaScript executed in an isolated worker — including modules that were written in TypeScript and compiled before shipping. connect owner/repo loads demos from a sandbox repository and runs them in that same worker.
Up and down arrows walk your command history. Ctrl + L clears the screen. Esc interrupts a running demo, or cancels a connect that is still fetching.
sandbox.json at the root. schema is 1, runner is "worker", and demos lists demo files relative to the manifest.Demos.define('name', { title, blurb, lang }, fn), the same shape as demos/collatz.js. The name in that call is the command. Compile TypeScript first. Relative imports of other files in the repo work. Leave node: imports out of those files; they run in a browser worker.connect owner/repo@ref pins a tag, branch, or commit. A local server is connect http://127.0.0.1:8080/. Opening this page with ?sandbox=owner/repo links it on load.demos lists what was linked. run hello runs one. link shows the manifest URL. disconnect drops the link and restores a built-in that shared a name.connect owner/repo demos run hello
Demos are ordinary functions. The terminal serialises each one, hands it to an isolated worker, and streams back everything it prints — including return values and thrown errors.
Modules authored in TypeScript are compiled to ES modules before shipping, so no compiler is downloaded at runtime. type-basics is one: its .ts source ships beside its build output.
Code runs in a Web Worker with no DOM access, in a throwaway scope, with a time limit. A runaway loop interrupts instead of freezing the page.
A sandbox repo publishes sandbox.json and demo files in the same shape as the ones here. Linking it fetches those files and resolves their relative imports against the repo.