Examples
Use these examples when you want a runnable starting point instead of reading package-by-package reference material first.
Run everything
bash
npm install
npm run build
npm run examplesExample index
| Example | What it shows | When to start here |
|---|---|---|
execbox-basic.ts | Resolve a provider and execute guest code with QuickJS. | You want the smallest end-to-end example. |
execbox-process.ts | Run the same provider flow inside a child-process executor. | You want a stronger lifecycle boundary than in-process execution. |
execbox-worker.ts | Run the same provider flow inside a worker-thread executor. | You want QuickJS off the main thread. |
execbox-remote.ts | Run the same provider flow through a transport-backed executor. | You already own the runtime boundary and want execbox to plug into it. |
execbox-mcp-provider.ts | Wrap MCP tools into a provider and execute against them. | You want guest code to call upstream MCP tools as code. |
execbox-mcp-server.ts | Expose mcp_search_tools, mcp_execute_code, and mcp_code. | You want downstream MCP clients to execute code against a wrapped tool namespace. |
execbox-isolated-vm-basic.ts | Run the same provider flow on the isolated-vm backend. | You explicitly want the isolated-vm runtime. |
What to read next
- Getting Started for the minimal QuickJS install path
- Architecture for how providers, executors, and protocol layers fit together
- Security before choosing a production boundary