API reference

ES-Runtime is ESM-only and deny-by-default: a run reaches what the command line that started it named, and nothing else. Host functionality is exposed as ES modules under the runtime: scheme — never as ambient globals — and every operation is gated on an explicit capability.

The runtime: scheme

Built-in modules are imported with a runtime: specifier. They are served from a baked, in-binary registry before any injected loader runs, and never touch the filesystem. The security boundary is the op, not the module: importing always succeeds, but an operation throws unless its capability has been granted.

JavaScript
import { env, args } from "runtime:process";

Built-in modules

ModuleStatusCapability
runtime:contextAvailable
runtime:diagnosticsAvailableDiagnosticsObserve / DiagnosticsDetail
runtime:processAvailableEnv / Signals
runtime:pathAvailableEnv (only to read cwd())
runtime:fsAvailableFileRead / FileWrite
runtime:netAvailableNet / NetListen
runtime:httpAvailableNetListen
runtime:websocketAvailableNetListen
runtime:serializationAvailable
runtime:hashingAvailable— (Entropy for password.hash)
runtime:systemAvailableRun
runtime:workersAvailableFileRead / FileWrite
runtime:wasiAvailable— to construct; its file calls need FileRead / FileWrite
runtime:buildAvailable — esdev onlyFileRead (FileWrite to write())
runtime:testAvailable — esdev only
runtime:watchAvailable — esdev onlyFileRead
Last updated on
Edit this page