Node.js is an open source and completely free software that empowers web developers to build scalable and fast network programs. Being based on Chrome’s JavaScript runtime, the Node.js software is extremely efficient and lightweight, especially because it uses a non-blocking, event-driven I/O model.
The top platform for running server-side JavaScript code
Node.js is currently considered the top platform for running server-side JavaScript code, being used in production in big companies like Google, eBay, Yahoo, LinkedIn, Microsoft, Cloud9 and many more.
Mandatory example
The following code will create a simple web server that responds with “Hello World” for every request.
var http = require(‘http’);
http.createServer(function (req, res) {
res.writeHead(200, {‘Content-Type’: ‘text/plain’});
res.end(‘Hello Worldn’);
}).listen(1337, ‘127.0.0.1’);
console.log(‘Server running at http://127.0.0.1:1337/’);
In order to run the HTTP server, you will have to the code above into a file called “example.js” (without quotes) and execute it with the node command from a terminal emulator:
% node example.js
Server running at http://127.0.0.1:1337/
Supported operating systems
Node.js is a multi-platform application that has been successfully tested under numerous GNU/Linux distributions, including Debian, Ubuntu, Arch Linux, Fedora, Red Hat Enterprise Linux, openSUSE, Mageia, Slackware, and others, as well as on the commercial Mac OS X and Microsoft Windows operating systems. Both 64-bit and 32-bit instruction set architectures are supported at this time.
Under the hood, requirements and availability
As mentioned, this is a multi-platform software. It can be downloaded as pre-built installers for the Mac OS X, GNU/Linux and Microsoft Windows operating systems, as well as a universal source archive that can be compiled and installed on virtually any operating system where Python is supported.