1. What is Node.js
[1] node is a server-side JavaScript interpreter, but really think JavaScript good students learn node can easily take off, then you are wrong, summed up: the depth is not deep I do not know, but really not shallow.
[2] Node's goal is to help programmers build highly scalable applications and write connection codes that handle tens of thousands of simultaneous connections to one physical machine. Handling high concurrency and asynchronous I/O is one of the reasons that node is concerned by developers.
[3] Node itself runs Google V8 JavaScript engine, so the speed and performance is very good, see chrome, and node to its encapsulation also improved its ability to process binary data. Therefore, node not only uses V8, but also optimizes it to make it more power in various environments.
[4] third-party extensions and modules play an important role in the use of node. The download NPM,NPM is the management tool for the module, which installs various node packages (such as Express,redis, etc.) and publishes the packages that you write for node.
2, Node.js Installation
[1]windows platform can only download and install
[2]linux under the platform:
wget http://nodejs.org/dist/v0.6.1/node-v0.10.31.tar.gz
tar zxvf node-v0.10.31.tar.gz
CD node-v0.10.31
./configure
3. Simple case
var http = require (' http ');
Http.createserver (function (req, res) {
res.writehead ({' Content-type ': ' Text/plain '});
Res.end (' Hello world\n ');
Listen (3000, "127.0.0.1");
Console.log (' Server running at Http://127.0.0.1:3000/');
The "Hello World" can be viewed through browser access.