process.stdout

process.stdout A Writable Stream to stdout (on fd 1). For example, a console.log equivalent could look like this: console.log = (msg) => { process.stdout.write(`${msg}\n`); }; process.stderr and process.stdout are unlike other streams in Node.js in that they cannot be closed (end() will throw), they never emit the 'finish' event and that writes can block when output is redirected to a file (although disks are fast and operating systems normally employ write-back caching so it should be a

process.stderr

process.stderr A writable stream to stderr (on fd 2). process.stderr and process.stdout are unlike other streams in Node.js in that they cannot be closed (end() will throw), they never emit the finish event and that writes can block when output is redirected to a file (although disks are fast and operating systems normally employ write-back caching so it should be a very rare occurrence indeed.)

process.setuid()

process.setuid(id) Note: this function is only available on POSIX platforms (i.e. not Windows, Android) Sets the user identity of the process. (See setuid(2).) This accepts either a numerical ID or a username string. If a username is specified, this method blocks while resolving it to a numerical ID. if (process.getuid && process.setuid) { console.log(`Current uid: ${process.getuid()}`); try { process.setuid(501); console.log(`New uid: ${process.getuid()}`); } catch (e

process.send()

process.send(message[, sendHandle[, options]][, callback]) message <Object> sendHandle <Handle object> options <Object> callback <Function> Return: <Boolean> When Node.js is spawned with an IPC channel attached, it can send messages to its parent process using process.send(). Each will be received as a 'message' event on the parent's ChildProcess object. Note: this function uses JSON.stringify() internally to serialize the message. If Node.js was not s

process.setgroups()

process.setgroups(groups) Note: this function is only available on POSIX platforms (i.e. not Windows, Android) Sets the supplementary group IDs. This is a privileged operation, meaning you need to be root or have the CAP_SETGID capability. The list can contain group IDs, group names or both.

process.setegid()

process.setegid(id) Note: this function is only available on POSIX platforms (i.e. not Windows, Android) Sets the effective group identity of the process. (See setegid(2).) This accepts either a numerical ID or a groupname string. If a groupname is specified, this method blocks while resolving it to a numerical ID. if (process.getegid && process.setegid) { console.log(`Current gid: ${process.getegid()}`); try { process.setegid(501); console.log(`New gid: ${process.getegid(

process.seteuid()

process.seteuid(id) Note: this function is only available on POSIX platforms (i.e. not Windows, Android) Sets the effective user identity of the process. (See seteuid(2).) This accepts either a numerical ID or a username string. If a username is specified, this method blocks while resolving it to a numerical ID. if (process.geteuid && process.seteuid) { console.log(`Current uid: ${process.geteuid()}`); try { process.seteuid(501); console.log(`New uid: ${process.geteuid()}`

process.setgid()

process.setgid(id) Note: this function is only available on POSIX platforms (i.e. not Windows, Android) Sets the group identity of the process. (See setgid(2).) This accepts either a numerical ID or a groupname string. If a groupname is specified, this method blocks while resolving it to a numerical ID. if (process.getgid && process.setgid) { console.log(`Current gid: ${process.getgid()}`); try { process.setgid(501); console.log(`New gid: ${process.getgid()}`); } catch

process.release

process.release An Object containing metadata related to the current release, including URLs for the source tarball and headers-only tarball. process.release contains the following properties: name: a string with a value that will always be 'node' for Node.js. For legacy io.js releases, this will be 'io.js'. sourceUrl: a complete URL pointing to a .tar.gz file containing the source of the current release. headersUrl: a complete URL pointing to a .tar.gz file containing only the header file

process.pid

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