Create, serialize, receive
Follow one message from object to wire JSON and back.
Open round-trip recipe →Native module playground
Change the JavaScript, press Run, and inspect each console value. The editor executes the checked-in index.js module—there is no playground-only copy of js-message.
Bundlers resolve the bare js-message import normally. Native browser ESM, including this playground, resolves it through a standard import map, with no build or transpilation step.
Live workbench
Put package imports and absolute-URL one-line static imports before executable code. The runner then uses a fresh, time-limited module worker inside a sandboxed editor; your snippet cannot reach or rewrite the documentation page.
The playground blocks fetch, WebSocket, and cross-origin module requests. Same-origin module imports, browser storage, and messaging APIs remain available, and the runner stops long-running snippets after three seconds. Browser code can still consume CPU or memory until that limit takes effect.
Focused recipes
Keep this workbench short, then open a focused page for the complete source and explanation.
Follow one message from object to wire JSON and back.
Open round-trip recipe →See invalid input become a serializable error message.
Open recovery recipe →Prove instance-only fields never enter the transport envelope.
Open boundary recipe →Keep building
Use the protocol page to lock the envelope shape, then copy a boundary recipe for WebSockets, fetch, workers, or IPC.