Node.js API compatibility - Process
This documentation explores the usage and integration of the Node.js Process module within the Azion Runtime. The Process module is an essential part of Node.js, enabling interaction with the current Node.js process, providing information, and controlling its execution.
The process module in Node.js is a global object that provides information and control over the current Node.js process. It’s essential for interacting with the runtime environment and managing the execution of Node.js applications. This module is available in the Azion Runtime through Node.js compatibility, where a frequent use case is reading environment variables, such as process.env, or scheduling work with nextTick inside a function.
Example: Environment variables and nextTick
The example below shows how to use the process module in a function:
Example: Reading configuration from environment variables
Access configuration values stored in environment variables:
Example: Using nextTick for deferred execution
Schedule work to run after the current operation completes:
Example: Process information and platform detection
Access runtime information about the process:
Example: Memory usage monitoring
Monitor memory consumption during execution:
Example: Uptime and timing
Track process uptime for health monitoring:
Supported APIs
| API | Status |
|---|---|
process.env | 🟢 Supported |
process.nextTick() | 🟢 Supported |
process.platform | 🟢 Supported |
process.arch | 🟢 Supported |
process.version | 🟢 Supported |
process.versions | 🟢 Supported |
process.pid | 🟢 Supported |
process.ppid | 🟢 Supported |
process.uptime() | 🟢 Supported |
process.hrtime() | 🟢 Supported |
process.hrtime.bigint() | 🟢 Supported |
process.memoryUsage() | 🟢 Supported |
process.cwd() | 🟡 Partially supported |
process.exit() | 🟡 Partially supported |
process.on() | 🟡 Partially supported |
process.argv | 🟡 Partially supported |
process.title | 🟡 Partially supported |