JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 36
  • Score
    100M100P100Q95752F
  • License (MIT OR Apache-2.0)

The fastest way to run untrusted JavaScript safely. Zero-config, Bun-first.

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.js
import { 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 }); // 42

Performance: 66,000 ops/sec (Bun) / 380,000 ops/sec (Node.js) with pooling enabled.

See the full documentation for the complete API reference.