Node.js is open source, cross-platform, and since its introduction in 2009, it got hugely popular and now plays a significant role in the web development scene.

It provides an event driven, non-blocking (asynchronous) I/O and cross-platform runtime environment for building highly scalable server-side application using JavaScript.

Both your browser JavaScript and Node.js run on the Google chrome's V8 JavaScript runtime engine.

This engine takes your JavaScript code and converts it into a faster machine code. Machine code is low level code which the computer can run without needing to first interpret it.

Nodejs is majorly used for developing server side web applications. It is not javascript frameworks, many of the Nodejs's basics modules are written in javascript.

  • Node.js is an open-source framework under MIT license.
  • Uses JavaScript to build entire server side application.
  • Node.js is built on Google Chrome's V8 JavaScript Engine, so its library is very fast in code execution
  • Node.js follows a single threaded model with event looping
  • Asynchronous by default. So it performs faster than other frameworks.
  • Cross-platform framework that runs on Windows, MAC or Linux, and many more
  • java script is used on client side but Nodejs makes the javascript to be used on server side as well., we can achieve same language on server side and client side.
  • Nodejs is event based rather than multi-threaded, Only on thread is present
  • NodeJS can handle lot of concurrent requests

Install NodeJs

Follow below steps to install nodejs, Some of belos steps requires Admin access

  • Open the official page for Node.js
  • Download Node.js for Windows by clicking the Windows Installer option
  • windows-installer-nodejs
  • Run the downloaded Node.js .msi Installer - including accepting the license, selecting the destination, and authenticating for the install.
  • installation-of-nodejs
  • To ensure Node.js has been installed, run node -v in your cmd - you should get something like v6.9.5
  • nodejs-version
  • Update your version of npm with npm install npm --global if necessary
  • You've now got Node.js installed in your sytsem
Node.js can also be installed via a package manager. The package manager for windows is known as Chocolatey.

Hello World in Node js

Let's follow the basics program of programming and start by creating a program which will print hello mars on the console as output.

This code-snippet is as simple as it can be, Place below code in a file called hello-mars.js

//file-name : hello-mars.js
console.log('hello world');	

You can run the above file using the following command on Command prompt/Terminal:

node hello-mars.js

Output of the above command: hello-world-nodejs

About Author

Article is written by Pavan (a) KarthiQ. Well, I am serving notice period in an MNC, Bangalore. I thought to enrich every person knowledge a little, I always have a feeling, when we teach something, we will learn more than what you know. Knowledge is the only thing that doubles when you spend it.

I have also created the reporter for Protractor Jasmine. Use for your projects without any hesitation

Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions