1. Download
  2. ChangeLog
  3. Build
  4. About
  5. Links
  6. Contributing
  7. Documentation

Evented I/O for V8 JavaScript.

An example of a web server written in Node which responds with "Hello World" for every request.

var http = require('http');
http.createServer(function (req, res) {
  res.end('Hello World\n');
}).listen(8124, "");
console.log('Server running at');


% node example.js
Server running at

Here is an example of a simple TCP server which listens on port 8124 and echoes whatever you send it:

var net = require('net');
net.createServer(function (socket) {
  socket.write("Echo server\r\n");
  socket.on("data", function (data) {
  socket.on("end", function () {
}).listen(8124, "");

See the API documentation for more examples.


git repo

Stable: 2010.12.30 node-v0.2.6.tar.gz

Unstable: 2010.12.16 node-v0.3.2.tar.gz

Historical: versions, docs


Node is tested on Linux, Macintosh, and Solaris. It also runs on Windows/Cygwin, FreeBSD, and OpenBSD. The build system requires Python 2.4 or better. V8, on which Node is built, supports only IA-32, x64, and ARM processors. V8 is included in the Node distribution. To use TLS, OpenSSL is required. There are no other dependencies.

make install

Then have a look at the API documentation.

To run the tests

make test


Node's goal is to provide an easy way to build scalable network programs. In the "hello world" web server example above, many client connections can be handled concurrently. Node tells the operating system (through epoll, kqueue, /dev/poll, or select) that it should be notified when a new connection is made, and then it goes to sleep. If someone new connects, then it executes the callback. Each connection is only a small heap allocation.




But what about multiple-processor concurrency? Aren't threads necessary to scale programs to multi-core computers? Processes are necessary to scale to multi-core computers, not memory-sharing threads. The fundamentals of scalable systems are fast networking and non-blocking design—the rest is message passing. In future versions, Node will be able to fork new processes (using the Web Workers API ) which fits well into the current design.

See also:


Patches are welcome. The process is simple:

git clone git://github.com/ry/node.git
cd node
(make your changes)
./configure --debug
make test-all # Check your patch with both debug and release builds
git format-patch HEAD^

Be sure the your patch includes your full name and your valid email address. Git can be configured to do this like so:

git config --global user.email "ry@tinyclouds.org"
git config --global user.name "Ryan Dahl"

Before your code your code can be accepted you have to sign the contributor license agreement.


You should ask the mailing list if a new feature is wanted before working on a patch.