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

assert.notDeepEqual()

assert.notDeepEqual(actual, expected[, message]) Tests for any deep inequality. Opposite of assert.deepEqual(). const assert = require('assert'); const obj1 = { a : { b : 1 } }; const obj2 = { a : { b : 2 } }; const obj3 = { a : { b : 1 } } const obj4 = Object.create(obj1); assert.notDeepEqual(obj1, obj1); // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } assert.notDeepEqual(obj1, obj2); // OK, obj1 and obj2 are not deeply equal assert.notDeepEqual

pause event (Readline)

Event: 'pause' function () {} Emitted whenever the input stream is paused. Also emitted whenever the input stream is not paused and receives the SIGCONT event. (See events SIGTSTP and SIGCONT) Example of listening for 'pause': rl.on('pause', () => { console.log('Readline paused.'); });

secureConnect event (tls.TLSSocket)

Event: 'secureConnect' This event is emitted after the handshaking process for a new connection has successfully completed. The listener will be called regardless of whether or not the server's certificate has been authorized. It is the user's responsibility to test tlsSocket.authorized to see if the server certificate was signed by one of the specified CAs. If tlsSocket.authorized === false then the error can be found in tlsSocket.authorizationError. Also, if either ALPN or NPN was used tlsSoc

cluster.isMaster

cluster.isMaster <Boolean> True if the process is a master. This is determined by the process.env.NODE_UNIQUE_ID. If process.env.NODE_UNIQUE_ID is undefined, then isMaster is true.

process.getgid()

process.getgid() Note: this function is only available on POSIX platforms (i.e. not Windows, Android) Gets the group identity of the process. (See getgid(2).) This is the numerical group id, not the group name. if (process.getgid) { console.log(`Current gid: ${process.getgid()}`); }

request.setTimeout()

request.setTimeout(timeout[, callback]) Once a socket is assigned to this request and is connected socket.setTimeout() will be called. timeout {Number} Milliseconds before a request is considered to be timed out. callback {Function} Optional function to be called when a timeout occurs. Same as binding to the timeout event.

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.

crypto.createVerify()

crypto.createVerify(algorithm) Creates and returns a Verify 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'.

querystring.stringify()

querystring.stringify(obj[, sep][, eq][, options]) Serialize an object to a query string. Optionally override the default separator ('&') and assignment ('=') characters. Options object may contain encodeURIComponent property (querystring.escape by default), it can be used to encode string with non-utf8 encoding if necessary. Example: querystring.stringify({ foo: 'bar', baz: ['qux', 'quux'], corge: '' }) // returns 'foo=bar&baz=qux&baz=quux&corge=' querystring.stringify({foo