Examples
Each example is a complete project with file layout, source, build commands, and run notes. Pick one near your problem shape; every page links to the relevant module docs at the bottom.
By host environment
Section titled “By host environment”- Frontend — todo list with reactive DOM updates. Vite + vanilla DOM. Output is static.
- Backend — WebSocket server with per-connection signals and an SSE stats endpoint. Node 18+.
- Edge — Durable Object rate limiter with
whenblocks for once-per-window alerts. Cloudflare Workers.
IoT and hardware
Section titled “IoT and hardware”- Multi-plant auto waterer — moisture sensors + pumps + tank-level sensor with
when-block edge alerts. Real ADS1115 + Pi GPIO, plus a simulator that runs on any host. - GPIO state over HTTP + SSE — button + LED exposed as a live web surface. One
effect { }block writes the LED AND broadcasts to every SSE client.
Voice and ML
Section titled “Voice and ML”- Voice assistant — wake-word → STT → LLM → TTS → speaker, with one grammar-constrained tool that flips a real GPIO LED. ~35 lines.
- Voice assistant + MCP — same loop, bridged to a real MCP server (Context7 for live library docs, plus the official memory server for persistent recall). One
mcp.connect()flattens every tool into the bot. - Smart camera — V4L2 capture → motion detector → save a JPEG snapshot whenever motion fires. Three Parabun modules glued by an async iterator.
Data engineering
Section titled “Data engineering”- Streaming ETL — 10M-element
|>pipeline with SIMD primitives. ~5-6× over.map().reduce(). Cross-runtime. - Parquet ETL — synthesize 50K events, write Parquet with bloom filters, demonstrate row-group skip on targeted queries. Cross-runtime.
# Install the @para/* packages your code uses, e.g.:npm install @para/signals @para/parallel @para/arrow
# .pts / .pjs files compile with parabun build:parabun build src/main.pts --outfile dist/main.jsCompiled output is standard JavaScript with import "@para/foo" statements — bundlers resolve those through node_modules with no additional config.
Build targets
Section titled “Build targets”| Project | parabun build target | Runner |
|---|---|---|
| Frontend / browser | --target browser | Vite, esbuild, etc. |
| Backend / Node | --target node | node dist/... |
| Edge / Workers | --target browser | Wrangler |
| IoT / voice / vision | (Parabun-only) | parabun src/... |
| Data ETL | any target | any host |