Skip to main content

Module process

Module process 

Source
Expand description

Node process global — the subset packages read at load time.

Data properties (process.env, process.argv, process.platform, the stdout/stderr stream stand-ins, …) are served through constant; callable members (process.cwd(), process.hrtime(), the EventEmitter-style on/emit no-ops, …) through call. process.nextTick is intentionally NOT handled here — it stays on the core microtask path in builtins.rs.

Constants§

METHODS
Callable members. nextTick is deliberately absent (handled in builtins).

Functions§

call
constant
emit_before_exit
Emit process.on('beforeExit', code). Node fires this when the loop has drained but the process has NOT been told to exit, and — unlike exit — work scheduled from a handler is honoured, so the loop runs again and beforeExit can fire repeatedly. It never fires after an explicit process.exit() or an uncaught exception.
emit_deprecation_warning
A DeprecationWarning fires at most once per code per process, matching the warned latches Node keeps at each deprecation site.
emit_exit_event
Emit process.on('exit', code) exactly once per process, the way Node’s process._exiting latch does — process.exit() inside an exit handler must not re-enter it.
emit_warning
Port of internal/process/warning.js onWarning: render a warning to stderr as (node:PID) [CODE] Name: message, followed by an optional detail line and the one-time trace hint. Suppressed by --no-warnings, and deprecations additionally by --no-deprecation.
install_argv
Publish Node’s process.argv / process.execArgv split for this run, read off the real command line. Called once by the node binary’s entry point; first call wins.
set_exit_code
The process.exitCode setter, ported from Node’s lib/internal/bootstrap/node.js accessor:
signal_number
A signal NAME ("SIGKILL", case-insensitive) to its number, or None if the name is not one this platform defines.
stream_instance_call
Instance methods of a process.stdout/stderr WriteStream: write/end emit the chunk raw (no newline) to the stream’s fd, so ordering interleaves correctly with console.log.