util.debug()

util.debug(string) Stability: 0 - Deprecated: Use console.error() instead. Deprecated predecessor of console.error.

url.parse()

url.parse(urlStr[, parseQueryString][, slashesDenoteHost]) Take a URL string, and return an object. Pass true as the second argument to also parse the query string using the querystring module. If true then the query property will always be assigned an object, and the search property will always be a (possibly empty) string. If false then the query property will not be parsed or decoded. Defaults to false. Pass true as the third argument to treat //foo/bar as { host: 'foo', pathname: '/bar' }

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'

upgrade event (http.Server)

Event: 'upgrade' function (request, socket, head) { } Emitted each time a client requests a http upgrade. If this event isn't listened for, then clients requesting an upgrade 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 upgraded stream, this may be empty. After this event is emitted, the request's socket wi

url.format()

url.format(urlObj) Take a parsed URL object, and return a formatted URL string. Here's how the formatting process works: href will be ignored. path will be ignored. protocol is treated the same with or without the trailing : (colon).The protocols http, https, ftp, gopher, file will be postfixed with :// (colon-slash-slash) as long as host/hostname are present. All other protocols mailto, xmpp, aim, sftp, foo, etc will be postfixed with : (colon). slashes set to true if the protocol requi

upgrade event (http.ClientRequest)

Event: 'upgrade' function (response, socket, head) { } Emitted each time a server responds to a request with an upgrade. If this event isn't being listened for, clients receiving an upgrade header will have their connections closed. A client server pair that show you how to listen for the 'upgrade' event. const http = require('http'); // Create an HTTP server var srv = http.createServer( (req, res) => { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('okay'); }); srv.on('

unpipe event (stream.Writable)

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

unref()

unref() The opaque value returned by setTimeout and setInterval also has the method timer.unref() which allows the creation of a timer that is active but if it is the only item left in the event loop, it won't keep the program running. If the timer is already unrefd calling unref again will have no effect. In the case of setTimeout, unref creates a separate timer that will wakeup the event loop, creating too many of these may adversely effect event loop performance -- use wisely. Returns the

unhandledRejection event (Process)

Event: 'unhandledRejection' Emitted whenever a Promise is rejected and no error handler is attached to the promise within a turn of the event loop. When programming with promises exceptions are encapsulated as rejected promises. Such promises can be caught and handled using promise.catch(...) and rejections are propagated through a promise chain. This event is useful for detecting and keeping track of promises that were rejected whose rejections were not handled yet. This event is emitted with

uncaughtException event (Process)

Event: 'uncaughtException' The 'uncaughtException' event is emitted when an exception bubbles all the way back to the event loop. By default, Node.js handles such exceptions by printing the stack trace to stderr and exiting. Adding a handler for the 'uncaughtException' event overrides this default behavior. For example: process.on('uncaughtException', (err) => { console.log(`Caught exception: ${err}`); }); setTimeout(() => { console.log('This will still run.'); }, 500); // Intenti