Blog Archives

How process.nextTick() works in Node.js?

Tweet The process object is a one of the few global objects provided by the Node.js core API. It can be access from anywhere, thus its methods can also be accessed. Such is a method called process.nextTick() which is used

Posted in Node.Js

Node.js Update

Tweet To update node to latest version, you can install n sudo npm install -g n Then just : sudo n latest Result will be like : dileep@dileep:~/Desktop/node$ sudo n latest install : node-v8.4.0 mkdir : /usr/local/n/versions/node/8.4.0 fetch : https://nodejs.org/dist/v8.4.0/node-v8.4.0-linux-x64.tar.gz

Posted in Node.Js

Middleware

Tweet we have used existing middleware (body-parser, cookie-parser, static, and connect-session, to name a few), and we’ve even written some of our own (when we check for the presence of &test=1 in the querystring, and our 404 handler). But what

Posted in Express, Node.Js Tagged with: ,

Developing template engines for Express

Tweet To develop template engines for Express ,Use the app.engine(ext, callback) method to create your own template engine. ext refers to the file extension, callback is the template engine function which accepts the location of the file, the options object,

Posted in Express, Node.Js Tagged with: ,

Response Object ?

Tweet The response object (which is normally passed to a callback, meaning you can name it whatever you want: it is common to name it res, resp, or response) starts its life as an instance of http.ServerResponse, a core Node

Posted in Express, Node.Js

Request Object ?

Tweet The Request Object The request object (which is normally passed to a callback, meaning you can name it whatever you want: it is common to name it req or request) starts its life as an instance of http.IncomingMessage, a

Posted in Express, Node.Js Tagged with: ,

Cluster ?

Tweet A single instance of Node runs in a single thread. To take advantage of multi-core systems the user will sometimes want to launch a cluster of Node processes to handle the load. The cluster module allows you to easily

Posted in Node.Js Tagged with:

Express JS to Deliver HTML Files (1)

Tweet How to load and “display” a basic HTML file : There are many ways to simply send the html file using the node’s core api of using the readfile,but the easy way to do is using the Express Framework

Posted in Express, Node.Js

Node JS to Deliver HTML Files

Tweet Node JS to Deliver HTML Files: The HTTP module is used to start up HTTP servers and respond to HTTP requests from users. The fs module is used to read the file system.Node js to deliver the html file

Posted in Express, Node.Js Tagged with:

Express JS to Deliver HTML Files

Tweet How to load and “display” a basic HTML file : There are many ways to simply send the html file using the node’s core api of using the readfile,but the easy way to do is using the Express Framework

Posted in Express, Node.Js Tagged with: ,