Getting Started
Execbox works best when you start with QuickJS, get one provider flow working, and then choose a stronger boundary only when your deployment needs it.
Requirements
- Node.js 22+
- npm
Install
bash
npm install @execbox/core @execbox/quickjsSmallest working example
ts
import { resolveProvider } from "@execbox/core";
import { QuickJsExecutor } from "@execbox/quickjs";
const provider = resolveProvider({
name: "tools",
tools: {
greet: {
inputSchema: {
type: "object",
required: ["name"],
properties: {
name: { type: "string" },
},
},
execute: async (input) => `Hello, ${(input as { name: string }).name}!`,
},
},
});
const executor = new QuickJsExecutor();
const result = await executor.execute(`await tools.greet({ name: "World" })`, [
provider,
]);
console.log(result);Which package should I use?
- Use
@execbox/quickjsfirst unless you already know you need a separate runtime boundary. - Use
@execbox/processwhen you want QuickJS semantics in a separate child process. - Use
@execbox/workerwhen you want QuickJS off the main thread with pooled workers. - Use
@execbox/remotewhen your runtime already lives behind an application-owned transport. - Use
@execbox/isolated-vmonly when you explicitly want that runtime and can support--no-node-snapshot.
Run the examples
The repo includes runnable examples for each main deployment shape:
bash
npm install
npm run build
npm run examplesFor the isolated-vm lane:
bash
npm run example:execbox-isolated-vm
npm run verify:isolated-vmNext:
- Examples for runnable flows
- Architecture for the deeper technical model
- Security before choosing a production boundary