process.pid

process.pid The PID of the process. console.log(`This process is pid ${process.pid}`);

process.nextTick()

process.nextTick(callback[, arg][, ...]) callback <Function> Once the current event loop turn runs to completion, call the callback function. This is not a simple alias to setTimeout(fn, 0), it's much more efficient. It runs before any additional I/O events (including timers) fire in subsequent ticks of the event loop. console.log('start'); process.nextTick(() => { console.log('nextTick callback'); }); console.log('scheduled'); // Output: // start // scheduled // nextTick callb

process.memoryUsage()

process.memoryUsage() Returns an object describing the memory usage of the Node.js process measured in bytes. const util = require('util'); console.log(util.inspect(process.memoryUsage())); This will generate: { rss: 4935680, heapTotal: 1826816, heapUsed: 650472 } heapTotal and heapUsed refer to V8's memory usage.

process.mainModule

process.mainModule Alternate way to retrieve require.main. The difference is that if the main module changes at runtime, require.main might still refer to the original main module in modules that were required before the change occurred. Generally it's safe to assume that the two refer to the same module. As with require.main, it will be undefined if there was no entry script.

process.kill()

process.kill(pid[, signal]) Send a signal to a process. pid is the process id and signal is the string describing the signal to send. Signal names are strings like SIGINT or SIGHUP. If omitted, the signal will be SIGTERM. See Signal Events and kill(2) for more information. Will throw an error if target does not exist, and as a special case, a signal of 0 can be used to test for the existence of a process. Windows platforms will throw an error if the pid is used to kill a process group. Note t

process.initgroups()

process.initgroups(user, extra_group) Note: this function is only available on POSIX platforms (i.e. not Windows, Android) Reads /etc/group and initializes the group access list, using all groups of which the user is a member. This is a privileged operation, meaning you need to be root or have the CAP_SETGID capability. user is a user name or user ID. extra_group is a group name or group ID. Some care needs to be taken when dropping privileges. Example: console.log(process.getgroups());

process.hrtime()

process.hrtime() Returns the current high-resolution real time in a [seconds, nanoseconds] tuple Array. It is relative to an arbitrary time in the past. It is not related to the time of day and therefore not subject to clock drift. The primary use is for measuring performance between intervals. You may pass in the result of a previous call to process.hrtime() to get a diff reading, useful for benchmarks and measuring intervals: var time = process.hrtime(); // [ 1800216, 25 ] setTimeout(() =&

process.getuid()

process.getuid() Note: this function is only available on POSIX platforms (i.e. not Windows, Android) Gets the user identity of the process. (See getuid(2).) This is the numerical userid, not the username. if (process.getuid) { console.log(`Current uid: ${process.getuid()}`); }

process.getgroups()

process.getgroups() Note: this function is only available on POSIX platforms (i.e. not Windows, Android) Returns an array with the supplementary group IDs. POSIX leaves it unspecified if the effective group ID is included but Node.js ensures it always is.

process.getgid()

process.getgid() Note: this function is only available on POSIX platforms (i.e. not Windows, Android) Gets the group identity of the process. (See getgid(2).) This is the numerical group id, not the group name. if (process.getgid) { console.log(`Current gid: ${process.getgid()}`); }