Sunday, February 10, 2013

Node.js tutorial 1 - Introduction


Node.js is a emerging technology with the help of which you can make
-simple Web servers
-command line tools and scripts
-live communication

 Node.js is a server-side javascript.It is based on Google Chrome's V8 Engine.
 Node.js is basically javascript without a browser , it doesnt require a browser to run javascript codes.
With Node.js , you can make highly scalable web servers .

In this tutorial , we will make a simple "Hello World" application using Node.js

REQUIREMENTS

-Node
You can download from nodejs.org and install it

- editor
You  can  use  notepad++  or Javascript Editor and install it

Code

1) open your editor and write the following code in it and save it as "helloworld.js".
console.log command logs on console the specified string which is passed as parameter to it.


notepad ++

2)open your command prompt and browse to the "helloworld.js" and enter the command
   node helloworld.js



3)you will get Hello World as output in the console

here you are done..!!

Here we are using node locally , we can do this from different computers by making an simple http Server , and ping to the server from different computers

We will do that in the next tutorial

Thanks !!