Globals reference

Every ambient global available in a default cruft realm without an import: the ECMAScript language intrinsics, the web-platform globals (fetch, Streams, crypto), the Node-shaped globals (process, Buffer, require), and the Compartment primitive. Notes which are enumerable and which are engine-internal.

Every ambient global in a default cruft realm, 241 own properties on globalThis. Most are installed non-enumerable, so Object.keys(globalThis) stays comparatively small (57 entries) and iteration-based code sees a mostly clean global object.

Compartment realms do not get this surface; they start empty and receive only what you grant (see Compartments and capabilities; a fresh compartment realm carries the standard language intrinsics, just none of the ambient host globals below).

ECMAScript language intrinsics

The full modern set, per the zero-skip test262 conformance suite. A few carry caveats worth stating up front: global is a Node alias for globalThis; WeakRef and FinalizationRegistry currently hold their referents strongly and never collect or finalize (see ECMAScript features); Temporal does not yet expose Instant.epochSeconds or epochMicroseconds, so use epochMilliseconds or epochNanoseconds (see Temporal); alongside the named binary types below there is the full typed-array family, including Float16Array and Uint8ClampedArray; and escape/unescape are the Annex B pair.

Fundamental
ObjectFunctionBooleanSymbolNumberBigIntStringArrayMathJSONReflectProxyDateRegExpIteratorPromiseevalglobalThisglobalundefinedNaNInfinity
Errors
ErrorAggregateErrorEvalErrorRangeErrorReferenceErrorSyntaxErrorTypeErrorURIErrorSuppressedError
Collections & memory
MapSetWeakMapWeakSetWeakRefFinalizationRegistry
Binary
ArrayBufferSharedArrayBufferDataViewAtomics
Resource management
DisposableStackAsyncDisposableStack
Namespaces
IntlTemporalWebAssemblyShadowRealm
Functions
parseIntparseFloatisNaNisFiniteencodeURIencodeURIComponentdecodeURIdecodeURIComponentescapeunescape

Web platform globals

A few notes carry across the groups below: fetch responses stream through response.body; crypto is the WebCrypto object; the event classes in the last row are the ones packages feature-detect; and console is substantive, with group/table/count/time all functioning. Beyond the concrete stream classes listed, the Streams API also ships the full controller/reader/writer machinery: BYOB readers and requests, default readers and controllers, and queuing strategies.

Fetch family
fetchRequestResponseHeaders
URL
URLURLSearchParams
Streams
ReadableStreamWritableStreamTransformStreamReadableByteStreamControllerCompressionStreamDecompressionStreamTextEncoderStreamTextDecoderStream
Encoding & data
TextEncoderTextDecoderBlobFileFormDataatobbtoastructuredClone
Crypto
cryptoSubtleCryptoCryptoKey
Events
EventTargetEventCustomEventAbortControllerAbortSignalDOMException
Feature-detected events
MessageEventCloseEventErrorEventProgressEventFocusEventBeforeUnloadEvent
Messaging
MessageChannelMessagePortBroadcastChannel
Timers & scheduling
setTimeoutclearTimeoutsetIntervalclearIntervalsetImmediateclearImmediatequeueMicrotask
Diagnostics
consoleperformancePerformanceObserver
  • navigator: a minimal shape: { hardwareConcurrency, userAgent: "cruft/0.0.10 (node-compat)" }. The userAgent is the runtime-detection surface.

Node-shaped globals

  • process: the global process object (see core modules).
  • Buffer: global, as in Node.
  • require and module: available at the global surface so CJS idioms work in scripts and -e one-liners.
  • Module-namespace globals: a Cruft convenience Node does not have: every built-in module's namespace is also installed as a non-enumerable global, including sub-namespaces exposed under underscored names. The crypto global is tinted below because it is the WebCrypto object, not the Node crypto module; reach the Node module via require("crypto") or import.

``chips Module namespaces | fs, path, os, http, events, stream, util, zlib, crypto*, dns, net, tls, dgram, child_process Sub-namespaces | fs_promises, stream_web, dns_promises, timers_promises, util_types, __node_assert ``

One-liners can say cruft -e 'console.log(path.join("a","b"))' with no import. Because they are non-enumerable and shadowable, ordinary code that declares its own path is unaffected, but don't rely on them in library code; import properly. The list is representative, not exhaustive: the rest of the built-in modules follow the same rule.

  • print: a convenience direct-write printer.

Cruft-specific globals

  • Compartment: the isolation primitive (see the CLI reference for its constructor surface).
  • __cruft_* internals (__cruft_fs, __cruft_path, __cruft_pm, …), the host primitives beneath the node:* adapters, plus CruftScript boundary machinery (__cruftscript_*, __cs_*) and diagnostic/trace hooks (__resolution_trace, __symbol_lookup_log, …). Most are non-enumerable, though some (e.g. __cruft_fs, __cruft_os, the __cruft_internal_test_runner_* pair) currently enumerate; all are engine-internal: not API, subject to change without notice, documented here only so an inventory of globalThis has no unexplained residents. User code should never touch them; sealed-mode and capability semantics assume they are not part of your program's surface.

Stability notes

  • The language and web-platform tiers follow their specs; compatibility exceptions are documented, not silent.
  • The module-namespace globals and print are conveniences: fine in one-liners and scripts, not recommended in published packages.
  • Anything prefixed __ is internal, whatever it looks like.

Enumerated from cruft 0.0.10 via Object.getOwnPropertyNames(globalThis); 241 own properties, 57 enumerable.