Thursday, October 29, 2015

Hello World with node.js

I have been hearing a lot from programmers about node.js. A server side javascript framework which can accomplish all the server side tasks. Lets see how to use node.js




What the hell is node.js. ? 


We can imagine it like a python which we install on the machine and do all scheduling tasks except it is in javascript language.

How it is built ? It is built on top of Google's Javascript Engine.

So, lets start how to write a simple hello world example with node.js. This example node js tutorial for beginners helps you to start using node.js

Installing Node JS (on Windows)


Go to nodejs website and download windows executable version if your machine is 64bit, you can download 64bit.exe

Copy the downloaded node.exe file to any desired location. eg: copy to C:\

Since it is exe we immediately run it, you dont have to do that.

Create a sample hello-world.js


create a file hw.js in C:\ and put below text

console.log("Hello World");


Running hello-world.js


You can hw.js passing as an argument to node.exe, open your command prompt and enter below command

C:\ node.exe hw.js


Results : Hello World


Also checkout Top 10 Javascript frameworks and Top CSS frameworks





No comments:

Post a Comment