Tag - Node.js

What is the difference between process.nextTick() and setImmediate() ?

The difference between process.nextTick() and setImmediate() is that process.nextTick() defers the execution of action till the next pass around the event loop or it simply calls the callback function once the ongoing execution of the event loop is finished whereas setImmediate() executes a callback on the next cycle of the event loop and it gives back to the event loop for executing any I/O operations. 🔗Source: codingdefined.com

Read more...

What are LTS releases of Node.js? why should you care?

LTS(Long Term Support) An LTS(Long Term Support) version of Node.js receives all the critical bug fixes, security updates and performance improvements. LTS versions of Node.js are supported for at least 18 months and are indicated by even version numbers (e.g. 4, 6, 8). They're best for production since the LTS release line is focussed on stability and security, whereas the Current release line has a shorter lifespan and more frequent updates to the code. Changes to LTS versions are limited to bug fixes for stability,...

Read more...

Node.js v13.1.0 Documentation

Node.js v13.1.0 Documentation Index View on single page View as JSON View another version ▼ Edit on GitHub Table of Contents HTTPClass: http.Agentnew Agent([options])agent.createConnection(options[, callback])agent.keepSocketAlive(socket)agent.reuseSocket(socket, request)agent.destroy()agent.freeSocketsagent.getName(options)agent.maxFreeSocketsagent.maxSocketsagent.requestsagent.socketsClass: http.ClientRequestEvent: 'abort'Event: 'connect'Event: 'continue'Event: 'information'Event: 'response'Event: 'socket'Event: 'timeout'Event: 'upgrade'request.abort()request.abortedrequest.connectionrequest.end([data[, encoding]][, callback])request.finishedrequest.flushHeaders()request.getHeader(name)request.maxHeadersCountrequest.pathrequest.removeHeader(name)request.reusedSocketrequest.setHeader(name, value)request.setNoDelay([noDelay])request.setSocketKeepAlive([enable][, initialDelay])request.setTimeout(timeout[, callback])request.socketrequest.writableEndedrequest.writableFinishedrequest.write(chunk[, encoding][, callback])Class: http.ServerEvent: 'checkContinue'Event: 'checkExpectation'Event: 'clientError'Event: 'close'Event: 'connect'Event: 'connection'Event: 'request'Event: 'upgrade'server.close([callback])server.headersTimeoutserver.listen()server.listeningserver.maxHeadersCountserver.setTimeout([msecs][, callback])server.timeoutserver.keepAliveTimeoutClass: http.ServerResponseEvent: 'close'Event: 'finish'response.addTrailers(headers)response.connectionresponse.end([data[, encoding]][, callback])response.finishedresponse.flushHeaders()response.getHeader(name)response.getHeaderNames()response.getHeaders()response.hasHeader(name)response.headersSentresponse.removeHeader(name)response.sendDateresponse.setHeader(name, value)response.setTimeout(msecs[, callback])response.socketresponse.statusCoderesponse.statusMessageresponse.writableEndedresponse.writableFinishedresponse.write(chunk[, encoding][, callback])response.writeContinue()response.writeHead(statusCode[, statusMessage][, headers])response.writeProcessing()Class: http.IncomingMessageEvent: 'aborted'Event: 'close'message.abortedmessage.completemessage.destroy([error])message.headersmessage.httpVersionmessage.methodmessage.rawHeadersmessage.rawTrailersmessage.setTimeout(msecs[, callback])message.socketmessage.statusCodemessage.statusMessagemessage.trailersmessage.urlhttp.METHODShttp.STATUS_CODEShttp.createServer([options][, requestListener])http.get(options[, callback])http.get(url[, options][, callback])http.globalAgenthttp.maxHeaderSizehttp.request(options[, callback])http.request(url[, options][, callback]) HTTP# Stability: 2 - Stable To use the HTTP server and client one must require('http'). The HTTP interfaces in...

Read more...