From last few months i came across the the coolest thing in programming and because of that i’m gonna teach my childrens that ‘N’ is for NodeJS ;)
The main idea of Node.js is to use non-blocking, event-driven I/O to remain lightweight and efficient in the face of data-intensive real-time applications that run across distributed devices…… it means you can use node for whatever you want, the way you like.
Let me show you how to install and run few easy programs based on nodeJS.
- First thing install it, you gonna need nodejs and npm (Node package manager), you will need it to install diffrent node packages , packages are just like a gems in Ruby or Jars in Java.
Walah .. you got all you want (y), not put the below code say in server.js
But this gonna spawn the single threaded application for you sticking to only one core, we have quad, hexa, octa core processors now day, how node will adjust with it? well, node can do preety anything, Cluster is there for you.
install package with npm
and run below code say in cluster.js
When i did a performacen testing of clustered code, it sucked all juice of my XPS, and fan was running like a Ferrari.
And i said Req/sec : 13266.56 Wow :) Loved NodeJS ♥
A small but awesome tutorial i found on youtube, hope you will love it.
Happy coding .. :)