diff --git a/website/node.html b/website/node.html index e64b5934430..a11115ae473 100644 --- a/website/node.html +++ b/website/node.html @@ -112,8 +112,14 @@ a:hover { text-decoration: underline; }
Purely asynchronous I/O for Purely asynchronous server-side I/O for V8 javascript. + +
Analogy +
+Python : Twisted +Ruby : Event Machine +Javascript : Node
This is an example of a web server written with Node which responds with "Hello World" after waiting two seconds: @@ -127,13 +133,6 @@ a:hover { text-decoration: underline; } }).listen(8000); puts("Server running at http://127.0.0.1:8000/"); -
-Node is an evented sandbox where users cannot execute blocking I/O. -This is -already natural for Javascript programmers, as the DOM is almost entirely -asynchronous. The goal is a framework to easily create -efficient network applications. -
See the API documentation for more examples.
@@ -164,6 +163,14 @@ make install
on. All methods and members are camel cased. Constructors
always have a capital first letter.
+
Node uses strings to represent ASCII or UTF-8 encoded data. For the +moment, arrays of integers are used to represent raw binary data—this +representation is rather inefficient. In the future, when V8 natively supports binary +Blob objects, Node will use them. + +
The following are some global general purpose functions:
+puts(string, callback)node.httpNode provides a web server and client interface. The interface is rather -low-level but complete (it does not limit you from -any of HTTP's features). The interface abstracts the transfer-encoding (i.e. -chunked or identity), message boundaries, and persistent connections. +
The HTTP interfaces here are designed to support many features +of the protocol which have been traditionally difficult to handle. In +particular, large, possibly chunked, messages. The interface is +careful to never buffer entire requests or responses—the user is able +to stream data.
HTTP message headers are represented by an array of 2-element arrays like this