Monday, September 22, 2014

NodeJS Basics


I like to share some information on NodeJs.

What is NodeJs.
NodeJs is a cross-platform runtime environment for server-side and networking applications.
Node.js applications are written in JavaScript, and can be run within the Node.js runtime on OS X, Microsoft Windows and Linux with no changes.
Node.js internally uses the Google V8 JavaScript engine to execute code, and a large percentage of the basic modules are written in JavaScript. 

In this section, I will tell you on the below points:
1. How to install NodeJs
2. How to install NPM
3. How to install
4. How to run nodejs from CLI

1) Installation:
I install the NodeJs on Ubuntu 14.04 O.S with the below command:

# sudo apt-get install nodejs

2) Install NPM(Node Package Manager):

# sudo apt-get install npm

Here, NPM basically a package manager.
NPM is helpful to maintain the NodeJS  dependency in your development.

3) Install
Basically it is useful to maintain the socket connection with your frontend and backend. Or you can say..
Its provide you a real time communication between your node.js server and clients.
Installation command:
# sudo npm install

4) Run the NodeJs:
Applications are executed from the command line with the command:

# nodejs <application name>.js

In my next article, i will demonstrate your how to use it in real time communication.

No comments :