What is Node.js? It's a Javascript library run on the V8 engine, the same one used in Google Chrome; and it's used to create a server on a fly to run web apps.
Advantages of it:
- it's slim and fast
- it's event driven
1. First question I asked was where Node.js is useful.
Since Javascript is event driven, it's useful when a server action should be triggered on a user action. If we consider just a request/response model, then the response it returned to this particular user only. But sometimes we want updates for all the users, such as in a chat room or in an interactive game. Then we can take advantage of the Node.js event driven nature.
2. Installation
Follow those instructions to install Node.
3. Eclipse plugin for Node.js development
I'm an ex Java developer so I like using Eclipse for everything. VJET plugin can be downloaded from here . It's a plugin to develop Javascript projects. Don't forget to install the Node.js and other Javascript type libraries you might need.
I didn't find a way to start a server in Eclipse (is Javascript still considered front end only?), so just open a terminal, go to your workspace directory, then to your project and start your server from there.
4. Trying it out
There is a great beginner book to start with Node. Please, click and read the links provided in the text, they give extended information on the methodology.
5. Trying it out more
Build a simple chat using Node.js