Created by Camel Aissani / @camelaissani
Inspired by Jeff Kunkle
Node.jsĀ® is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.
Delegate the I/O part to a Thread Pool or when it is possible to a native asynchronous I/O API
Delegate I/O part and manage callbacks
npm is the default package manager for Node.js.
It manages dependencies for an application.
It also allows users to install Node.js applications that are available on the npm registry.
Multi-Platform (Linux, Mac, Windows)
One development language JS on client and server side
Open source technology
Many NPM packages availables on npmjs.org
Short learning curve (Event loop theory, JavaScript, Evented programming)
var fs = require('fs');
fs.readFile('./sample.txt', 'utf8', function (err,data) {
if (err) {
return console.log(err);
}
console.log(data);
});
var http = require('http');
http.createServer(function(req, res) {
res.writeHead(200, {'Content-Type':'text/plain'});
res.end('Hello World');
}).listen(8000, '127.0.0.1');
console.log('Server running at http://localhost:8000/');