Node.js Streams, Pipe and chaining

A stream in Node.js is an abstract interface that is implemented by various objects. Thanks to Node.js’s asynchronous and event-driven nature, it excels at handling I/O-bound tasks and streams, which are similar to Unix pipes. For example, an HTTP server request is a stream, just like the standard output (stdout). The request is a readable […]

Introduction to WebSockets – Server, Client examples using Node.js

Initially the paradigm about web was Client/Server model, in which clients job is to request data from a server, and a servers job is to fulfill those requests. This paradigm fulfills the web requirement for number of years, but later on with Introduction of AJAX makes us enable to communicate with server asynchronously. Now using AJAX it was easy […]

Express.Js Middleware, What is next()?

You may have noticed use of next() function while looking at node.js code. Express is a routing web framework which utilize essentially a series of middleware calls. piece of code for a simple route could be like bellow. app.get(‘/users/:id’, function(req, res) { // logic to fetch user for provided id. }); and with a additional parameter next app.get(‘/users/:id’, […]