diff --git a/website/api.html b/website/api.html index a87f721b3b..dc1a0cf690 100644 --- a/website/api.html +++ b/website/api.html @@ -103,7 +103,7 @@ representation is rather inefficient. This will change in the future, when Stops a interval from triggering. -

node.fs

+

node.fs

File I/O is tricky because there are not simple non-blocking ways to do it. Node handles file I/O by employing Node has a simple module loading system. In Node, files and modules are in one-to-one correspondence. - -

As an example, +As an example, foo.js loads the module mjsunit.js.

The contents of foo.js: @@ -730,7 +729,7 @@ exports.assertEquals = function (expected, found, name_opt) { }; -

Here the module mjsunit.js has exported the function +

The module mjsunit has exported a function assertEquals(). mjsunit.js must be in the same directory as foo.js for include() to find it. The module path is relative to the file calling include(). @@ -742,12 +741,11 @@ from the specified module into the global namespace.

Because file loading does not happen instantaneously, and because Node has a policy of never blocking, the callback onLoad can be set and will notify the user -when all the included modules are loaded. Each file/module can have an onLoad callback.

To export an object, add to the special exports object. - -

The functions fail and deepEquals are not +The functions fail and deepEquals are not exported and remain private to the module.

require() is like include() except does not diff --git a/website/index.html b/website/index.html index cddf99c65f..30a922f7fe 100644 --- a/website/index.html +++ b/website/index.html @@ -17,26 +17,28 @@

Purely evented I/O for V8 javascript. -

This is an example of a web server written with Node which responds with +

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) {
+
+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/");
+puts("Server running at http://127.0.0.1:8000/"); +
-

To run the server, put the code into a file server.js +

To run the server, put the code into a file example.js and execute it with the node program -

% /usr/local/bin/node server.js
+
% /usr/local/bin/node example.js
 Server running at http://127.0.0.1:8000/
 
-

See the API documentation for more examples. +

See the API documentation for more examples.

Node is released under an MIT license.

@@ -48,18 +50,23 @@ Server running at http://127.0.0.1:8000/

Build

Node aims to support all POSIX operating systems (including -Windows with mingw). However at the moment it is only being tested on -Macintosh and Linux. +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. -

V8, on which Node is built, supports only IA-32 and ARM processors. - -

The build system requires Python. - -

./configure
+
+./configure
 make
-make install
+make install +
+

To run the unit tests +

+./configure --debug
+make test
+
diff --git a/website/style.css b/website/style.css index d7bd92940e..4e9eb333bc 100644 --- a/website/style.css +++ b/website/style.css @@ -44,7 +44,7 @@ h1 a, h2 a, h3 a, h4 a pre, code { font-family: monospace; font-size: 14pt; - color: #fee; + color: #eee0e0; } pre { @@ -52,12 +52,6 @@ pre { border-left: 1px solid #444; } -dl { -} - -dt { -} - dd { margin: 1em 0; margin-left: 1em;