API Overview

This page indexes the JavaScript API surface available to guest code running on Elide. Three layers make up that surface:

  • The Elide global — runtime metadata plus the serve() entrypoint.
  • node: modules — Node.js built-in modules, resolvable by import or require, with or without the node: prefix. Some are implemented natively by Elide; the rest resolve through the embedded Node compatibility layer.
  • elide: modules — Elide-specific synthetic modules. These always require the elide: prefix.
  • Web / WHATWG + WinterCG globals — standards-based globals installed on globalThis (Fetch, Streams, URL, Encoding, timers, performance, and so on).

Every linked page below documents the real, implemented surface of a single module or global. Where a feature is partial or deferred, the per-module page says so. For measured JavaScript, WinterTC, and Node-API results from external compliance suites, see the Compatibility Matrix.

The Elide global

The Elide global is always present when running JavaScript on Elide. Its current public surface exposes runtime metadata and the serve() entrypoint.
MemberTypeDescription
Elide.versionstring (read-only)Version string of the running copy of Elide.
Elide.debugboolean (read-only)Whether this build has debugging features enabled.
Elide.releaseboolean (read-only)Whether this is a release-optimized build.
Elide.buildModestring (read-only)Build mode label reported by this binary; for example, dev.
Elide.targetArchitecturestring (read-only)Target architecture label reported by this binary; for example, x86-64-v3, native, or compatibility.
Elide.serve(options)(ServeOptions) => ServeHandleStart an HTTP/HTTPS server. The supplied fetch handler is invoked once per request and returns a Response or Promise.
Elide.serve(options) takes a ServeOptions dictionary — a fetch handler is required; port, hostname, cert, key, idleTimeoutMs, and maxBodyBytes are optional. It returns a ServeHandle carrying the resolved port, the bound hostname, and a close() function. See the WebIDL source for the full dictionary shapes.
javascript
Elide.version;            // → e.g. "1.0.0-beta..."
Elide.debug;              // → false in release builds

const server = Elide.serve({
  port: 8080,
  fetch(request) {
    return new Response("hello from Elide");
  },
});
server.port;              // → 8080
// server.close();        // stop accepting and drain

There is no Elide.http, Elide.db, or Elide.createContext — HTTP serving is Elide.serve (see the Elide Global), and databases are imported as elide: modules (below).

node: modules

Node built-in modules resolve through import or require, with or without the node: prefix (e.g. both import os from "node:os" and require("os") work).

The modules below have dedicated reference pages. Most are implemented natively by Elide. Some modules are backed by the embedded compatibility layer, and node:child_process is registered as an Elide shim whose entry points are not yet implemented — each page notes its specifics.
ModuleReference
node:assertnode:assert
node:async_hooksnode:async_hooks
node:buffernode:buffer
node:child_processnode:child_process
node:consolenode:console
node:cryptonode:crypto
node:diagnostics_channelnode:diagnostics_channel
node:domainnode:domain
node:eventsnode:events
node:fs (and node:fs/promises)node:fs
node:modulenode:module
node:osnode:os
node:pathnode:path
node:perf_hooksnode:perf_hooks
node:querystringnode:querystring
node:streamnode:stream
node:testnode:test
node:timers (and node:timers/promises)node:timers
node:urlnode:url
node:utilnode:util
node:v8node:v8
node:vmnode:vm
node:worker_threadsnode:worker_threads
node:zlibnode:zlib
The process object, the print / printErr functions, and the timer functions are installed as globals rather than imported modules:
SurfaceReference
process (argv / env / execArgv / …)process
print / printErrprint / printErr
setTimeout / setInterval / setImmediate / queueMicrotaskTimers
Elide also implements node:dns and node:dns/promises. Additional Node module names (e.g. net, tls, http) are recognized by the loader but are not yet documented as stable.

elide: modules

Elide-specific synthetic modules. These always require the elide: prefix and are registered lazily — importing one does not pollute the global scope.
ModuleImportDescriptionReference
elide:sqliteimport { Database } from "elide:sqlite"Embedded SQLite 3 (synchronous).Database
elide:postgresimport { Database } from "elide:postgres"PostgreSQL over a pooled JDBC connection (async).Database
elide:mysqlimport { Database } from "elide:mysql"MySQL over a pooled JDBC connection (async).Database
All three database drivers are covered on a single page — the Database API Reference. There is no Elide.db global, no ORM, and no query builder; each driver executes SQL directly. MongoDB and Redis are not supported.

Web / WHATWG + WinterCG globals

Standards-based globals installed on globalThis. These follow the WHATWG specifications and the WinterCG Minimum Common API.

WHATWG

SurfaceReference
fetch, Request, Response, Headers, Body, Blob, File, FormDataWHATWG Fetch
ReadableStream, WritableStream, TransformStream, BYOB readers, queuing strategiesWHATWG Streams
CompressionStream, DecompressionStreamWHATWG Compression Streams
URLURL
URLSearchParamsURLSearchParams
URLPatternURLPattern
TextEncoder, TextDecoder, TextEncoderStream, TextDecoderStreamEncoding
Event, CustomEvent, EventTargetDOM Events
AbortController, AbortSignalDOM Abort

WinterCG

SurfaceReference
navigator (WorkerNavigator)WorkerNavigator
atob, btoaBase64 decode / encode; throw a DOMException (InvalidCharacterError) on invalid input.
performance (High Resolution Time, User Timing, Performance Timeline)Performance
MessageChannel, MessagePort, MessageEventWeb Messaging
PromiseRejectionEvent (unhandledrejection / rejectionhandled)Promise Rejection Events
DOMExceptionDOMException

Host-internal primitives

The pages below document shared host-internal primitive layers that back the guest-visible APIs above. They are not directly visible to guest JavaScript, but are documented for contributors and for understanding backing behavior:
LayerReference
Crypto primitives (back node:crypto and crypto.subtle)Crypto primitives
Compression primitivesCompression primitives
Filesystem primitivesFilesystem primitives
Network transportNetwork transport
Process primitivesProcess primitives

See also