process

Node-compatible process metadata, environment, streams, and lifecycle helpers.

globalThis.process, node:process, process, and elide:process refer to the same object.

Common Node properties are available, including argv, execArgv, env, arch, platform, pid, ppid, version, versions, execPath, title, cwd(), umask(), exitCode, and exit().

console.log(process.platform, process.arch);
console.log(process.cwd());

if (process.env.CI) process.exitCode = 1;

Events and scheduling

process is an EventEmitter. It supports the standard listener methods and runtime events such as warning, beforeExit, exit, and uncaughtException.

process.nextTick(callback, ...args) runs before Promise and queueMicrotask callbacks at the next checkpoint:

const order = [];
process.nextTick(() => order.push("tick"));
Promise.resolve().then(() => order.push("promise"));
queueMicrotask(() => order.push("microtask"));
setImmediate(() => console.log(order));
// ["tick", "promise", "microtask"]

Standard streams

stdin, stdout, and stderr are Node streams. stdout and stderr expose their file descriptor through fd; terminal streams also expose TTY fields. Console output is routed through these streams, so replacing process.stdout.write intercepts console.log output.

Environment

process.env exposes the visible environment as a mutable object. See Environment Variables for Elide 1.5.0 loading, mutation, and subprocess behavior.

Partial metrics

hrtime(), cpuUsage(), memoryUsage(), and uptime() are callable. In Elide 1.5.0, cpuUsage() and memoryUsage() return empty objects, so do not rely on Node’s detailed metric fields. process.send and process.disconnect are unavailable outside a working fork IPC channel.