About node.js
These days everybody talks about node.js. Some of them boast about what cool things they did with node.js. Well, I need to catch up with these guys but I don't want to spend too much time learning node.js. So I set out a challenge myself to find out more about node.js in a short period of time.
So I downloaded node.js and all ready to go!
My first experiment with node
So I downloaded node.js and all ready to go!
My first experiment with node
- On my windows PC, I created a file test.js under C:\node-examples folder
- I added the following line in test.js: console.log("testing node");
- From command prompt, I ran the command "node test.js" and "testing node" came up. C:\node-examples>node test.js
- Viola! I was able to run my JavaScript file from command prompt using node.
- I modified test.js so that now it has the following content: function printLine(){
- From command prompt, I ran the command "node test.js" and "printing from node" came up. Nice!! C:\node-examples>node test.js
console.log("printing from node");
}
console.log(printLine());
Notes:
There is this site http://code.tutsplus.com/tutorials/nodejs-for-beginners--net-26314 where they have a simple but good tutorial on node.js! I am going to dive into that right away!
No comments:
Post a Comment