How to Download and use Node.js NPM Packages

  Let first define a few terms before we go deep into Node.js NPM Packages tutorial. Define terms What is NPM? NPM stands for Node.js Package manager.NPM manages thousands of modules which are hosted in www.npmjs.com. Some packages are free to use while others are restricted.  Installing Node.js  will automatically install NPM.You can also write your own […]

Read More


How to use Node.js Url Module to route application using url.pathname

Node.js Url Module is used to split URL into readable parts which can be hostname,pathname etc.Its inbuilt Node.js module. Including Node.js Url Module To use url module add below code

http url routing using url.pathname Below code creates a http server that accepts  http requests and forwards them accordingly.

Open your browser and enter […]

Read More


Using Node.js File System Module

Node.js File System Module helps you to work with files on your computer or server.You can read, edit, write, create or rename files. To use file system you need to import them i.e var fs=require(‘fs’) Reading Files To read files on your computer we use function fs.readFile() function. Let say you have below  HTML file […]

Read More


  Using Node.js Http Module

As I mentioned earlier in Node.js Modules tutorial,Node.js has built in modules and Http module is one of them. This module is used to transfer data over hyper text transfer protocol(http). To use http module we need to include it in our script  using require function. var http=require(‘http’); Creating a webserver using Node.js Http Module. […]

Read More


Creating Node.js Modules

Modules are javascript libraries that can be used in developing an application.They are set of functions. Types of Modules 1.Built in modules-these are node.js modules that can be used without installing them.Example of these modules are:- http-makes node.js act like http server. https-makes node.js act like https server etc.       How to include built in […]

Read More


Getting Started with Node.js tutorial

Node.js is a Javascript framework that allows you to run javascript on server. Learning by examples. First of all make sure you have downloaded and installed node.js before getting started with this tutorial. Hello word node.js application. Code

How to  run above code First save the file as  .js  file.Mine I saved as firstscript.js. Open […]

Read More