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.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.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.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.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.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.config

process.config An Object containing the JavaScript representation of the configure options that were used to compile the current Node.js executable. This is the same as the config.gypi file that was produced when running the ./configure script. An example of the possible output looks like: { target_defaults: { cflags: [], default_configuration: 'Release', defines: [], include_dirs: [], libraries: [] }, variables: { host_arch: 'x64', node_install_npm: 't

process.chdir()

process.chdir(directory) Changes the current working directory of the process or throws an exception if that fails. console.log(`Starting directory: ${process.cwd()}`); try { process.chdir('/tmp'); console.log(`New directory: ${process.cwd()}`); } catch (err) { console.log(`chdir: ${err}`); }