url.resolve()

url.resolve(from, to) Take a base URL, and a href URL, and resolve them as a browser would for an anchor tag. Examples: url.resolve('/one/two/three', 'four') // '/one/two/four' url.resolve('http://example.com/', '/one') // 'http://example.com/one' url.resolve('http://example.com/one', '/two') // 'http://example.com/two'

zlib.inflateRawSync()

zlib.inflateRawSync(buf[, options]) Decompress a Buffer or string with InflateRaw.

__filename

__filename {String} The filename of the code being executed. This is the resolved absolute path of this code file. For a main program this is not necessarily the same filename used in the command line. The value inside a module is the path to that module file. Example: running node example.js from /Users/mjr console.log(__filename); // /Users/mjr/example.js __filename isn't actually a global but rather local to each module.

dgram_socket.bind()

socket.bind([port][, address][, callback]) port <Number> - Integer, Optional address <String>, Optional callback <Function> with no parameters, Optional. Called when binding is complete. For UDP sockets, causes the dgram.Socket to listen for datagram messages on a named port and optional address. If port is not specified, the operating system will attempt to bind to a random port. If address is not specified, the operating system will attempt to listen on all addresses. O

dns.lookup()

dns.lookup(hostname[, options], callback) Resolves a hostname (e.g. 'nodejs.org') into the first found A (IPv4) or AAAA (IPv6) record. options can be an object or integer. If options is not provided, then IPv4 and IPv6 addresses are both valid. If options is an integer, then it must be 4 or 6. Alternatively, options can be an object containing these properties: family {Number} - The record family. If present, must be the integer 4 or 6. If not provided, both IP v4 and v6 addresses are accept

buffer.toString()

buf.toString([encoding[, start[, end]]]) encoding <String> Default: 'utf8' start <Number> Default: 0 end <Number> Default: buffer.length Return: <String> Decodes and returns a string from the Buffer data using the specified character set encoding. const buf = Buffer.allocUnsafe(26); for (var i = 0 ; i < 26 ; i++) { buf[i] = i + 97; // 97 is ASCII a } buf.toString('ascii'); // Returns: 'abcdefghijklmnopqrstuvwxyz' buf.toString('ascii',0,5); // Returns: '

util.puts()

util.puts([...]) Stability: 0 - Deprecated: Use console.log() instead. Deprecated predecessor of console.log.

dns.resolveTxt()

dns.resolveTxt(hostname, callback) Uses the DNS protocol to resolve text queries (TXT records) for the hostname. The addresses argument passed to the callback function is is a two-dimentional array of the text records available for hostname (e.g., [ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]). Each sub-array contains TXT chunks of one record. Depending on the use case, these could be either joined together or treated separately.

message event (Worker)

Event: 'message' message <Object> Similar to the cluster.on('message') event, but specific to this worker. This event is the same as the one provided by child_process.fork(). In a worker you can also use process.on('message'). As an example, here is a cluster that keeps count of the number of requests in the master process using the message system: const cluster = require('cluster'); const http = require('http'); if (cluster.isMaster) { // Keep track of http requests var num

fs.realpath()

fs.realpath(path[, cache], callback) Asynchronous realpath(2). The callback gets two arguments (err, resolvedPath). May use process.cwd to resolve relative paths. cache is an object literal of mapped paths that can be used to force a specific path resolution or avoid additional fs.stat calls for known real paths. Example: var cache = {'/etc':'/private/etc'}; fs.realpath('/etc/passwd', cache, (err, resolvedPath) => { if (err) throw err; console.log(resolvedPath); });