Skip to main content

Module process

Module process 

Source
Expand description

A deliberately small, sandbox-safe process, and the node:process module form of it.

Node’s process is mostly ambient authority; this exposes only the members that are either inert (platform/version/timing) or supplied by the host (env, cwd, argv). Everything that could escape a sandbox (binding, dlopen, chdir, kill, setuid, real exit) is absent or neutered, and env carries exactly the variables the host passes — empty unless it passes some.

The module form is not a second implementation: the object it hands back IS globalThis.process, so import process from 'node:process', require('process') and the bare global are one object, as in Node.

Structs§

ProcessOptions
What the host supplies to install.

Constants§

PROCESS_MEMBERS
The names the module re-exports. process itself is installed by the host; anything it does not set simply does not appear.

Functions§

install
Install globalThis.process. Called once per realm (the values are realm-stable: env is the host’s resolved allow-list, cwd its sandbox root, and the monotonic clock anchors here). The runtime’s name and version come from crate::identity.
process_object
globalThis.process.