An object containing the user environment. See environ(7).
### process.exit(code=0)
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 should see the exit code as 1.
### process.getgid()
Gets the group identity of the process. (See getgid(2).) This is the numerical group id, not the group name.
console.log('Current gid: ' + process.getgid());
### process.setgid(id)
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.
console.log('Current gid: ' + process.getgid());
try {
process.setgid(501);
console.log('New gid: ' + process.getgid());
}
catch (err) {
console.log('Failed to set gid: ' + err);
}
### process.getuid()
Gets the user identity of the process. (See getuid(2).) This is the numerical userid, not the username.
console.log('Current uid: ' + process.getuid());
### process.setuid(id)
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.
console.log('Current uid: ' + process.getuid());
try {
process.setuid(501);
console.log('New uid: ' + process.getuid());
}
catch (err) {
console.log('Failed to set uid: ' + err);
}
### process.version
A compiled-in property that exposes `NODE_VERSION`.
console.log('Version: ' + process.version);
### process.installPrefix
A compiled-in property that exposes `NODE_PREFIX`.
console.log('Prefix: ' + process.installPrefix);
### process.kill(pid, signal='SIGINT')
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 'SIGUSR1'. If omitted, the signal will be 'SIGINT'.
See kill(2) for more information.
Note that just because the name of this function is `process.kill`, it is
really just a signal sender, like the `kill` system call. The signal sent
may do something other than kill the target process.
Example of sending a signal to yourself:
process.on('SIGHUP', function () {
console.log('Got SIGHUP signal.');
});
setTimeout(function () {
console.log('Exiting.');
process.exit(0);
}, 100);
process.kill(process.pid, 'SIGHUP');
### process.pid
The PID of the process.
console.log('This process is pid ' + process.pid);
### process.title
Getter/setter to set what is displayed in 'ps'.
### process.platform
What platform you're running on. `'linux2'`, `'darwin'`, etc.
console.log('This platform is ' + process.platform);
### process.memoryUsage()
Returns an object describing the memory usage of the Node process.