Runtime APIs
Runtime globals
Your Worker gets Cloudflare's globals on Node.js, such as fetch(), Request, crypto, streams, timers, and WebSocket, under one fixed compatibility profile.
Runs on Node.js runtime with workerd-shaped globals, cloudflare:* and node:* modules
- Works
fetch(),Request,Response,Headers,URL, streams,crypto, timers,WebSocket, andWebSocketPair- Differs
- One fixed compatibility profile: Orange ignores your
compatibility_dateand mostcompatibility_flags - Missing
URL.createObjectURL(), custom fetchers, and some Cloudflare crypto algorithms- Migration
- Not needed A Worker holds no data. Deploy its code to Orange.
- Scales by
- Runner count
Your Worker sees the same globals as on Cloudflare, such as fetch(),
Request, Response, crypto, streams, timers, and WebSocket. Orange
installs them on Node.js before your Worker’s module loads.
Quickstart
-
Keep your Wrangler file
Leave
compatibility_dateandcompatibility_flagsas they are. Orange always runs2026-09-03withnodejs_compat.{ "name": "hash", "main": "src/index.ts", "compatibility_date": "2026-09-03", "compatibility_flags": ["nodejs_compat"] } -
Use the globals
Call
crypto,TextEncoder, andResponseas on Cloudflare.export default { async fetch(request): Promise<Response> { const data = new TextEncoder().encode(await request.text()); const digest = await crypto.subtle.digest("SHA-256", data); const hex = [...new Uint8Array(digest)].map((b) => b.toString(16).padStart(2, "0")).join(""); return Response.json({ sha256: hex }); }, } satisfies ExportedHandler; -
Run it
orange devwarns about each flag that it does not need:orange dev ! Orange always has Node.js APIs, so it does not need compatibility_flags ["nodejs_compat"]Hash a string:
curl -d hello localhost:8787 {"sha256":"2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824"}
How it works
- Orange installs every Cloudflare global before your Worker’s module runs, so code at module scope sees them too.
- Most are the Node.js and Undici implementations, adapted to match workerd where the conformance tests compare the two.
consolewrites to theorange devoutput. An unhandled rejection or an exception in a timer is printed there, and the Worker keeps running.
AI context Compatibility, limits and details
Written for LLMs and coding agents: every edge case, measurement, and known deviation. You do not need it to use the feature.
Compatibility
| Feature | Status | Notes |
|---|---|---|
atob, btoa, ByteLengthQueuingStrategy, CountQueuingStrategy, CustomEvent, queueMicrotask, TextDecoder, TextEncoder, and WebSocketRequestResponsePair | Supported | |
The other 68 globals, such as fetch, Headers, Request, Response, URL, URLSearchParams, Blob, FormData, DOMException, Event, the streams, crypto, console, performance, structuredClone, WebAssembly, WebSocket, WebSocketPair, caches, HTMLRewriter, scheduler, and the four timer functions | Partial | Each family has its own section below. |
Body, ExtendableEvent, FetchEvent, origin, ScheduledEvent, and TailEvent | Not supported | See The global manifest. |
URL.createObjectURL() | Not supported | See Deviations. |
compatibility_date and compatibility_flags | Partial | One fixed profile. See Compatibility date and flags. |
Limits
Orange does not copy Cloudflare’s resource limits on the globals (see Deviations). A global that Node.js or Undici backs has that implementation’s limits. A request has no time limit; see Fetch events.
The global manifest
Orange intersects the value-bearing declarations with the globals exposed across the pinned workerd global prototype chain. The current profile has 83 Cloudflare global names. Before it loads the Worker entrypoint, the runtime installs a manifest with exactly those names.
packages/runtime-node/src/globals/implementations.tsholds the status of each name: implemented, partial, or not implemented.- A partial value must be assignable to the complete Cloudflare contract. An implemented value also needs exact inferred types.
- A global that Orange does not implement keeps the Node.js value of that name
when Node.js has one. Otherwise it is a placeholder. Calling or constructing
it, or reading or setting a property, throws
Cloudflare global <name> is not implemented by OpenOrange. Headers,Request,Response,URL,URLSearchParams,Blob,DOMException,Event,ReadableStream,WritableStream,TransformStream,console, and the four timer functions are backed by pinned Undici or Node.js primitives.performanceandstructuredClone()use the captured Node.js web-platform implementations.WebAssemblyexposes the captured Node.js namespace.- The runtime captures the Node.js constructors and functions before it installs the Cloudflare manifest, so the HTTP substrate, Cap’n Web, and RivetKit keep using compatible host primitives.
- Node.js globals without a Cloudflare counterpart stay available at runtime, but the generated Worker types leave them out.
Compatibility date and flags
Orange runs one profile, 2026-09-03 with nodejs_compat. Worker code should
behave as it does on Node.js, so Orange does not switch runtime behavior by
date or flag. orange dev warns about each flag that it does not apply:
! Orange always has Node.js APIs, so it does not need compatibility_flags ["nodejs_compat"]
! Orange ignores compatibility_flags ["streams_enable_constructors"]
In wrangler.jsonc | On Orange |
|---|---|
compatibility_date | Ignored, except for static assets: from 2025-04-01, navigation requests prefer asset serving, as on Cloudflare. See Static assets. |
nodejs_compat, nodejs_compat_v2, and nodejs_als | Node.js APIs are always on. orange dev prints the first warning above. |
request_signal_passthrough and no_request_signal_passthrough | Applied. With request_signal_passthrough, a copy of an incoming request also follows its client’s disconnect. Without it, the default, a copy passed to a subrequest or over RPC does not. |
assets_navigation_prefers_asset_serving and assets_navigation_has_no_effect | Applied. See Static assets. |
| Any other flag | Ignored. orange dev prints the second warning above. |
HTTP
- The HTTP globals support normalized headers, repeated
Set-Cookievalues, buffered request and response bodies, cloning, the body readers, and theResponse.error(),Response.redirect(), andResponse.json()constructors. - URL parsing, mutation, query iteration, and live
searchParamsmutation work. - Outbound
fetch()converts an Orange request to the pinned Undici substrate, and wraps its response back into a Worker-compatible response.BlobandFormDatabodies work. - A request with a custom
fetcherthrowsNotSupportedError: Custom request fetchers are not implemented yet.TheencodeResponseBodyoption throwsNotSupportedError: encodeResponseBody is not implemented yet. - When Orange sends a response whose
Content-Encodingis exactlygziporbr, it compresses the body and dropsContent-Length, as workerd does. - A response created with
encodeBody: "manual"already holds encoded bytes, so Orange sends them as they are. - The two rules above apply to Worker responses, Durable Object
fetch()responses, and service binding responses, whose callers read the decoded body. - The encoding and HTTP implementations delegate their substrate behavior to Node.js, and conform to the pinned Cloudflare constructors.
Streams
- A
ReadableStreambody is used as is, so it locks only when the body is read. - Reading a body accepts any
ArrayBufferorArrayBufferViewchunk, as workerd does. - An iterable body becomes a stream whose
cancel()calls the iterator’sreturn(). - A byte
ReadableStreamthat does not setautoAllocateChunkSizegets workerd’s default of 4096 bytes, so a default read still exposescontroller.byobRequest.
WebSockets
WebSocketsupports outbound client connections, as RivetKit and Cap’n Web use them.WebSocketPaircreates two entangled Worker endpoints, with acceptance, queued delivery, copied text and binary frames, close validation, close events, and the latest default close auto-reply behavior.Responseaccepts a pair endpoint with status 101 and exposes it throughresponse.webSocket. The runtime couples that endpoint to real client and Durable Object transport connections.- A status-101 WebSocket response keeps its socket. It rejects cloning, a non-null body, a missing socket, and a status other than 101, as pinned workerd does.
serializeAttachment()anddeserializeAttachment()work on WebSocket endpoints.
Crypto
crypto delegates standard Web Crypto operations to Node.js. It adds the
Cloudflare extensions that the current Workers types use:
subtle.timingSafeEqual(), and streaming SHA-1, SHA-256, SHA-384, and SHA-512
digests through crypto.DigestStream.
Timers and microtasks
setTimeout()andsetInterval()return aTimeoutobject that converts to its numeric ID, as workerd does withenable_nodejs_global_timers. It hasref(),unref(),hasRef(), andrefresh(), for Node.js libraries that expect timer handles.- IDs come from one shared pool, and either clear function cancels a timeout or an interval.
queueMicrotask(),setTimeout(), andsetInterval()reject a callback that is not a function when they are called.
Errors and diagnostics
consoleforwards to the Node.js console captured before the Worker globals are installed, so Worker diagnostics reach theorange devoutput.- An unhandled promise rejection is reported as a background diagnostic, and does not stop the shared runtime process.
- The global scope dispatches
unhandledrejectionandrejectionhandledevents, as workerd does. - An exception thrown from a timer, a microtask, or an event listener is reported the same way, and does not stop the runtime process.
Deviations
fetch()decodesdeflateresponse bodies through Undici. Workerd decodes onlygzipandbr, and passes other codings through.URL.createObjectURL()throwsURL.createObjectURL is not implemented yet.- These are not implemented: Cloudflare-specific outbound request metadata, some Cloudflare crypto algorithms, exact stream queuing semantics, exact timer delays, scheduling and resource-limit behavior, performance-entry semantics, and structured-clone host types.
- A global that keeps its Node.js value behaves as Node.js does. Orange has not verified it against workerd.
Conformance
- The conformance check verifies that the global manifest has no missing or extra Cloudflare names, checks supported values against the reference contract, and runs behavior fixtures against the pinned Cloudflare runtime.
- The HTTP fixture compares header iteration and
Set-Cookiehandling, buffered request bodies, cloning, response constructors, status metadata, and the exact tested errors. - The WebSocket fixture compares the pair’s shape, upgrade responses, queued text and binary frames, close validation, event data, ready states, and close auto-reply.
- The check also verifies that the manifest is installed before the Worker module evaluates.
src/config/load-wrangler.test.tschecks that another compatibility date loads, and the two warnings for ignored flags.
Recorded results from the conformance run of 2026-11-10 (Orange ea40348), 1,670 of 1,851 tests passing across every area. Each check is works when every result passed and partial when some did. The full feature matrix is on the compatibility page.
Workers
| Check | Status | Results |
|---|