Monday, April 09, 2012

The Node Beginner Book » A comprehensive Node.js tutorial

The Node Beginner Book » A comprehensive Node.js tutorial


An excellent starter book for node.js,
available free on web, or together with another node.js e-book for $7.99.
Educational, not only about node.js but about functional and async programming.

Here is a "Hello, World" web server in node.js
var http = require("http");
http.createServer(function(request, response) {
  response.writeHead(200, {"Content-Type": "text/plain"});
  response.write("Hello World");
  response.end();
}).listen(8888);
That's all!
To run it:
node server.js
The whole experience for installing and running node.js on Windows is great.
One click installer, and then just run a single 4.5 MB file (from command line).
It is a long way from a year ago (previous post video),
when installing node.js required compiling the C/C++ source...

It is not surprising that node.js is super popular
JavaScript functions make code very compact and simple,
for those comfortable with code, not just drag/drop controls...
It is apparently very efficient, too.
So much so that it is also embedded into WebOS...