Default execbox executor for most deployments. It runs guest JavaScript in QuickJS and lets you keep the same API as you move between inline, worker-hosted, and process-hosted execution.
- you want the default execbox path with the easiest setup
- you do not want a native addon in local development or CI
- you want one package that can stay inline, move off-thread, or move into a child process later
npm install @execbox/core @execbox/quickjsimport { resolveProvider } from "@execbox/core";
import { QuickJsExecutor } from "@execbox/quickjs";
const provider = resolveProvider({
name: "tools",
tools: {
echo: {
execute: async (input) => input,
},
},
});
const executor = new QuickJsExecutor();
const result = await executor.execute(`await tools.echo({ ok: true })`, [
provider,
]);
console.log(result);QuickJsExecutor keeps the same execution API while changing where the runtime lives:
| Mode | Use it when |
|---|---|
| Inline (default) | You want the lowest-friction development path. |
host: "worker" |
You want QuickJS off the main thread with pooled worker shells. |
host: "process" |
You want QuickJS hosted in a child process with a stronger lifecycle split. |
const executor = new QuickJsExecutor({
host: "worker",
pool: {
maxSize: 4,
prewarm: true,
},
});
await executor.prewarm();@execbox/quickjs/runnerexports the reusable QuickJS runner@execbox/quickjs/runner/protocol-endpointexports the shared protocol endpoint used by hosted and remote flows
- Each execution gets a fresh QuickJS runtime with JSON-only tool and result boundaries.
- This package is the default deployment path, not a hard security boundary for hostile or multi-tenant code.
- If you need a stronger boundary, prefer
host: "process"or move execution behind@execbox/remote.