process.mainModule

process.mainModule Alternate way to retrieve require.main. The difference is that if the main module changes at runtime, require.main might still refer to the original main module in modules that were required before the change occurred. Generally it's safe to assume that the two refer to the same module. As with require.main, it will be undefined if there was no entry script.

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()}`); }

child_process.exec()

child_process.exec(command[, options][, callback]) command <String> The command to run, with space-separated arguments options <Object> cwd <String> Current working directory of the child process env <Object> Environment key-value pairs encoding <String> (Default: 'utf8') shell <String> Shell to execute the command with (Default: '/bin/sh' on UNIX, 'cmd.exe' on Windows, The shell should understand the -c switch on UNIX or /s /c on Windows. On Windows, c

crypto.pbkdf2Sync()

crypto.pbkdf2Sync(password, salt, iterations, keylen[, digest]) Provides a synchronous Password-Based Key Derivation Function 2 (PBKDF2) implementation. A selected HMAC digest algorithm specified by digest is applied to derive a key of the requested byte length (keylen) from the password, salt and iterations. If the digest algorithm is not specified, a default of 'sha1' is used. If an error occurs an Error will be thrown, otherwise the derived key will be returned as a Buffer. The iterations

path.parse()

path.parse(pathString) Returns an object from a path string. An example on *nix: path.parse('/home/user/dir/file.txt') // returns // { // root : "/", // dir : "/home/user/dir", // base : "file.txt", // ext : ".txt", // name : "file" // } An example on Windows: path.parse('C:\\path\\dir\\index.html') // returns // { // root : "C:\\", // dir : "C:\\path\\dir", // base : "index.html", // ext : ".html", // name : "index" // }

os.hostname()

os.hostname() Returns the hostname of the operating system.

buffer.writeInt8()

buf.writeInt8(value, offset[, noAssert]) value <Number> Bytes to be written to Buffer offset <Number> 0 <= offset <= buf.length - 1 noAssert <Boolean> Default: false Return: <Number> The offset plus the number of written bytes Writes value to the Buffer at the specified offset. The value should be a valid signed 8-bit integer. Behavior is not defined when value is anything other than a signed 8-bit integer. Set noAssert to true to skip validation of value an

fs.lchownSync()

fs.lchownSync(path, uid, gid) Synchronous lchown(2). Returns undefined.

net_server.close()

server.close([callback]) Stops the server from accepting new connections and keeps existing connections. This function is asynchronous, the server is finally closed when all connections are ended and the server emits a 'close' event. The optional callback will be called once the 'close' event occurs. Unlike that event, it will be called with an Error as its only argument if the server was not open when it was closed.

checkExpectation event (http.ClientRequest)

Event: 'checkExpectation' function (request, response) { } Emitted each time a request with an http Expect header is received, where the value is not 100-continue. If this event isn't listened for, the server will automatically respond with a 417 Expectation Failed as appropriate. Note that when this event is emitted and handled, the request event will not be emitted.