net_server.address()

server.address() Returns the bound address, the address family name and port of the server as reported by the operating system. Useful to find which port was assigned when giving getting an OS-assigned address. Returns an object with three properties, e.g. { port: 12346, family: 'IPv4', address: '127.0.0.1' } Example: var server = net.createServer((socket) => { socket.end('goodbye\n'); }).on('error', (err) => { // handle errors here throw err; }); // grab a random port. server.li

stream.Readable

Class: stream.Readable stream.Readable is an abstract class designed to be extended with an underlying implementation of the stream._read(size) method. Please see API for Stream Consumers for how to consume streams in your programs. What follows is an explanation of how to implement Readable streams in your programs. new stream.Readable([options]) options <Object> highWaterMark <Number> The maximum number of bytes to store in the internal buffer before ceasing to read from the u

util.isUndefined()

util.isUndefined(object) Stability: 0 - Deprecated Returns true if the given "object" is undefined. Otherwise, returns false. const util = require('util'); var foo; util.isUndefined(5) // false util.isUndefined(foo) // true util.isUndefined(null) // false

http.createServer()

http.createServer([requestListener]) Returns a new instance of http.Server. The requestListener is a function which is automatically added to the 'request' event.

setup event (Cluster)

Event: 'setup' settings <Object> Emitted every time .setupMaster() is called. The settings object is the cluster.settings object at the time .setupMaster() was called and is advisory only, since multiple calls to .setupMaster() can be made in a single tick. If accuracy is important, use cluster.settings.

stream.read()

stream.read(0) There are some cases where you want to trigger a refresh of the underlying readable stream mechanisms, without actually consuming any data. In that case, you can call stream.read(0), which will always return null. If the internal read buffer is below the highWaterMark, and the stream is not currently reading, then calling stream.read(0) will trigger a low-level stream._read() call. There is almost never a need to do this. However, you will see some cases in Node.js's internals

os.cpus()

os.cpus() Returns an array of objects containing information about each CPU/core installed: model, speed (in MHz), and times (an object containing the number of milliseconds the CPU/core spent in: user, nice, sys, idle, and irq). Example inspection of os.cpus: [ { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', speed: 2926, times: { user: 252020, nice: 0, sys: 30340, idle: 1070356870, irq: 0 } }, { model: 'Intel(R) Core(TM) i7 CPU 8

writable.cork()

Stability: 2 - Stable A stream is an abstract interface implemented by various objects in Node.js. For example a request to an HTTP server is a stream, as is process.stdout. Streams are readable, writable, or both. All streams are instances of EventEmitter. You can load the Stream base classes by doing require('stream'). There are base classes provided for Readable streams, Writable streams, Duplex streams, and Transform streams. This document is split up into 3 sections: The first section e

buffer.includes()

buf.includes(value[, byteOffset][, encoding]) value <String> | <Buffer> | <Number> byteOffset <Number> Default: 0 encoding <String> Default: 'utf8' Return: <Boolean> Operates similar to Array#includes(). The value can be a String, Buffer or Number. Strings are interpreted as UTF8 unless overridden with the encoding argument. Buffers will use the entire Buffer (to compare a partial Buffer use buf.slice()). Numbers can range from 0 to 255. The byteOffs

crypto.createSign()

crypto.createSign(algorithm) Creates and returns a Sign object that uses the given algorithm. On recent OpenSSL releases, openssl list-public-key-algorithms will display the available signing algorithms. One example is 'RSA-SHA256'.