Package Exports
- @grayhaven/sandcastle
- @grayhaven/sandcastle/codemode
Readme
@grayhaven/sandcastle
The fastest way to run untrusted JavaScript safely. Zero-config, Bun-first.
bun add @grayhaven/sandcastle # zero dependencies
npm install @grayhaven/sandcastle isolated-vm # Node.jsimport { evaluate, run } from "@grayhaven/sandcastle";
await evaluate("1 + 1"); // 2
await evaluate("x * y", { x: 6, y: 7 }); // 42
await run("return input.x * 2", { x: 21 }); // 42Performance: 66,000 ops/sec (Bun) / 380,000 ops/sec (Node.js) with pooling enabled.
See the full documentation for the complete API reference.