process.stdin

process.stdin A Readable Stream for stdin (on fd 0). Example of opening standard input and listening for both events: process.stdin.setEncoding('utf8'); process.stdin.on('readable', () => { var chunk = process.stdin.read(); if (chunk !== null) { process.stdout.write(`data: ${chunk}`); } }); process.stdin.on('end', () => { process.stdout.write('end'); }); As a Stream, process.stdin can also be used in "old" mode that is compatible with scripts written for node.js prior to v

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

process.platform What platform you're running on: 'darwin', 'freebsd', 'linux', 'sunos' or 'win32' console.log(`This platform is ${process.platform}`);