process.geteuid()

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

process.getegid()

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

process.exitCode

process.exitCode A number which will be the process exit code, when the process either exits gracefully, or is exited via process.exit() without specifying a code. Specifying a code to process.exit(code) will override any previous setting of process.exitCode.

process.exit()

process.exit([code]) Ends the process with the specified code. If omitted, exit uses the 'success' code 0. To exit with a 'failure' code: process.exit(1); The shell that executed Node.js should see the exit code as 1.

process.execPath

process.execPath This is the absolute pathname of the executable that started the process. Example: /usr/local/bin/node

process.execArgv

process.execArgv This is the set of Node.js-specific command line options from the executable that started the process. These options do not show up in process.argv, and do not include the Node.js executable, the name of the script, or any options following the script name. These options are useful in order to spawn child processes with the same execution environment as the parent. Example: $ node --harmony script.js --version results in process.execArgv: ['--harmony'] and process.argv: ['/

process.env

process.env An object containing the user environment. See environ(7). An example of this object looks like: { TERM: 'xterm-256color', SHELL: '/usr/local/bin/bash', USER: 'maciej', PATH: '~/.bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin', PWD: '/Users/maciej', EDITOR: 'vim', SHLVL: '1', HOME: '/Users/maciej', LOGNAME: 'maciej', _: '/usr/local/bin/node' } You can write to this object, but changes won't be reflected outside of your process. That means that the following wo

process.disconnect()

process.disconnect() Close the IPC channel to the parent process, allowing this child to exit gracefully once there are no other connections keeping it alive. Identical to the parent process's ChildProcess.disconnect(). If Node.js was not spawned with an IPC channel, process.disconnect() will be undefined.

process.cwd()

process.cwd() Returns the current working directory of the process. console.log(`Current directory: ${process.cwd()}`);

process.connected

process.connected <Boolean> Set to false after process.disconnect() is called If process.connected is false, it is no longer possible to send messages.