console.timeEnd()

console.timeEnd(label) Stops a timer that was previously started by calling console.time() and prints the result to stdout: console.time('100-elements'); for (var i = 0; i < 100; i++) { ; } console.timeEnd('100-elements'); // prints 100-elements: 225.438ms

console.error()

console.error([data][, ...]) Prints to stderr with newline. Multiple arguments can be passed, with the first used as the primary message and all additional used as substitution values similar to printf(3) (the arguments are all passed to util.format()). const code = 5; console.error('error #%d', code); // Prints: error #5, to stderr console.error('error', code); // Prints: error 5, to stderr If formatting elements (e.g. %d) are not found in the first string then util.inspect() is called on

console.info()

console.info([data][, ...]) The console.info() function is an alias for console.log().

console.assert()

console.assert(value[, message][, ...]) A simple assertion test that verifies whether value is truthy. If it is not, an AssertionError is thrown. If provided, the error message is formatted using util.format() and used as the error message. console.assert(true, 'does nothing'); // OK console.assert(false, 'Whoops %s', 'didn\'t work'); // AssertionError: Whoops didn't work

console.dir()

console.dir(obj[, options]) Uses util.inspect() on obj and prints the resulting string to stdout. This function bypasses any custom inspect() function defined on obj. An optional options object may be passed to alter certain aspects of the formatted string: showHidden - if true then the object's non-enumerable and symbol properties will be shown too. Defaults to false. depth - tells util.inspect() how many times to recurse while formatting the object. This is useful for inspecting large com

Console

Class: Console The Console class can be used to create a simple logger with configurable output streams and can be accessed using either require('console').Console or console.Console: const Console = require('console').Console; const Console = console.Console;

connection event (net.Server)

Event: 'connection' <net.Socket> The connection object Emitted when a new connection is made. socket is an instance of net.Socket.

connect event (http.Server)

Event: 'connect' function (request, socket, head) { } Emitted each time a client requests a http CONNECT method. If this event isn't listened for, then clients requesting a CONNECT method will have their connections closed. request is the arguments for the http request, as it is in the request event. socket is the network socket between the server and client. head is an instance of Buffer, the first packet of the tunneling stream, this may be empty. After this event is emitted, the reque

connect event (http.ClientRequest)

Event: 'connect' function (response, socket, head) { } Emitted each time a server responds to a request with a CONNECT method. If this event isn't being listened for, clients receiving a CONNECT method will have their connections closed. A client server pair that show you how to listen for the 'connect' event. const http = require('http'); const net = require('net'); const url = require('url'); // Create an HTTP tunneling proxy var proxy = http.createServer( (req, res) => { res.writeHe

connection event (http.Server)

Event: 'connection' function (socket) { } When a new TCP stream is established. socket is an object of type net.Socket. Usually users will not want to access this event. In particular, the socket will not emit 'readable' events because of how the protocol parser attaches to the socket. The socket can also be accessed at request.connection.