Node
Purely evented I/O for V8 javascript.
An example of a web server written with Node which responds with "Hello World" after waiting two seconds:
new node.http.Server(function (req, res) { setTimeout(function () { res.sendHeader(200, [["Content-Type", "text/plain"]]); res.sendBody("Hello World"); res.finish(); }, 2000); }).listen(8000); puts("Server running at http://127.0.0.1:8000/");
To run the server, put the code into a file example.js
and execute it with the node
program
% /usr/local/bin/node example.js Server running at http://127.0.0.1:8000/
See the API documentation for more examples.
Node is released under an MIT license.
Download
TODO
Build
Node aims to support all POSIX operating systems (including Windows with mingw) but at the moment it is only being tested on Linux, Macintosh, and FreeBSD. The build system requires Python. V8, on which Node is built, supports only IA-32 and ARM processors.
./configure make make install
To run the unit tests
./configure --debug make test