Saturday, April 9, 2016

Getting started with Node.js

What is Node.js?

Node.js is a buzzword in the software development industry and it has become a trend to develop enterprise level applications using Node. Some of the big companies are already converting their applications to Node. This seems to be good point to start to look in to Node.js.
This is an Open Source JavaScript runtime environment for developing server-side networking applications using JavaScript developed by Ryan Dahl in 2009. This uses Google Chrome V8 JavaScript Engine as Interpreter and libuv as the abstraction layer. Core libraries in Node.js itself are written in JavaScript. There is huge number of Packages available to use in Node.js with Node Package Manager (NPM). Node.js is cross platform, which can be deployed on Windows, Linux and OS X.

Node.js is very fast and highly scalable, due to its event driven and non-blocking I\O model. This enables to develop high throughput, real-time network applications with Node.js.

How to install

Node.js installation is simple. Download the installer from the Node.js web site and double click to install it. This for Windows users, but other OS’s it is the same as any other.
Bring up command prompt and type ‘node –version’ which will output the installed version of the Node.js. Now you can install the required package using npm. In the command prompt type, ‘npm install learnyounode’. This will install the package in the current folder location. learnyounode is the tutorial that we are going to use later.

IDE and tools

There are many IDE’s available that provide support for Node.js development. It is not essential to have IDE to develop node applications, but it makes it much easier. Remember you can always develop application with just using a notepad.

Among the common IDE’s Visual Studio is one of most feature rich and easy to use IDE. In addition, the community edition of the VS2015 is totally free. Adding Node.js Tools for Visual Studio gives all these features to node.js development and more. This tool is free and open source. This will also provide project templates to create common types of Node applications.


Tutorials

There are many tutorials available for learning node.js but I recommend using learnyounode. Tutorial itself is a npm package. This is good because it is interactive and well arranged. This will provide you with challenge to fulfil writing small node applications and verify whether you have done it correctly. It will provide you with some hints on how to do it and what functions or packages to use. This is entry level to node.js tutorial and assumes you know JavaScript. If it is not the case, there are courses for learning JavaScript or more advanced node topics. And this is also free and open source.


1 comment: