console.time()

console.time(label) Starts a timer that can be used to compute the duration of an operation. Timers are identified by a unique label. Use the same label when you call console.timeEnd() to stop the timer and output the elapsed time in milliseconds to stdout. Timer durations are accurate to the sub-millisecond.

assert.deepStrictEqual()

assert.deepStrictEqual(actual, expected[, message]) Generally identical to assert.deepEqual() with two exceptions. First, primitive values are compared using the strict equality operator ( === ). Second, object comparisons include a strict equality check of their prototypes. const assert = require('assert'); assert.deepEqual({a:1}, {a:'1'}); // OK, because 1 == '1' assert.deepStrictEqual({a:1}, {a:'1'}); // AssertionError: { a: 1 } deepStrictEqual { a: '1' } // because 1 !== '1' using

SIGCONT event (Readline)

Event: 'SIGCONT' function () {} This does not work on Windows. Emitted whenever the input stream is sent to the background with ^Z, respectively known as SIGTSTP, and then continued with fg(1). This event only emits if the stream was not paused before sending the program to the background. Example of listening for SIGCONT: rl.on('SIGCONT', () => { // `prompt` will automatically resume the stream rl.prompt(); });

path.extname()

path.extname(p) Return the extension of the path, from the last '.' to end of string in the last portion of the path. If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string. Examples: path.extname('index.html') // returns '.html' path.extname('index.coffee.md') // returns '.md' path.extname('index.') // returns '.' path.extname('index') // returns '' path.extname('.index') // returns ''

diffieHellman.setPublicKey()

diffieHellman.setPublicKey(public_key[, encoding]) Sets the Diffie-Hellman public key. If the encoding argument is provided and is either 'binary', 'hex' or 'base64', public_key is expected to be a string. If no encoding is provided, public_key is expected to be a Buffer.

ecdh.setPublicKey()

ecdh.setPublicKey(public_key[, encoding]) Stability: 0 - Deprecated Sets the EC Diffie-Hellman public key. Key encoding can be 'binary', 'hex' or 'base64'. If encoding is provided public_key is expected to be a string; otherwise a Buffer is expected. Note that there is not normally a reason to call this method because ECDH only requires a private key and the other party's public key to compute the shared secret. Typically either ecdh.generateKeys() or ecdh.setPrivateKey() will be called. The e

disconnect event (Cluster)

Event: 'disconnect' worker <cluster.Worker> Emitted after the worker IPC channel has disconnected. This can occur when a worker exits gracefully, is killed, or is disconnected manually (such as with worker.disconnect()). There may be a delay between the 'disconnect' and 'exit' events. These events can be used to detect if the process is stuck in a cleanup or if there are long-living connections. cluster.on('disconnect', (worker) => { console.log(`The worker #${worker.id} has di

process.version

process.version A compiled-in property that exposes NODE_VERSION. console.log(`Version: ${process.version}`);

agent.createConnection()

agent.createConnection(options[, callback]) Produces a socket/stream to be used for HTTP requests. By default, this function is the same as net.createConnection(). However, custom Agents may override this method in case greater flexibility is desired. A socket/stream can be supplied in one of two ways: by returning the socket/stream from this function, or by passing the socket/stream to callback. callback has a signature of (err, stream).

System Error

Class: System Error error.code error.errno Returns a string representing the error code, which is always E followed by a sequence of capital letters, and may be referenced in man 2 intro. The properties error.code and error.errno are aliases of one another and return the same value. error.syscall Returns a string describing the syscall that failed.