From 1ae69a68a474f886d6fe39ebe176ff251f718c53 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Tue, 29 Sep 2009 18:06:36 +0200 Subject: [PATCH] Clean up some text in documentation. --- doc/api.html | 83 +++++++++++++++++++++++++++------------------- doc/api.txt | 93 +++++++++++++++++++++++++++------------------------- doc/api.xml | 81 ++++++++++++++++++++++++++------------------- doc/node.1 | 14 ++++---- 4 files changed, 153 insertions(+), 118 deletions(-) diff --git a/doc/api.html b/doc/api.html index 77c896791f9..10de5657bdb 100644 --- a/doc/api.html +++ b/doc/api.html @@ -240,8 +240,8 @@ on error: exit code, stdout buffer, stderr buffer

Many objects in Node emit events: a TCP server emits an event each time there is a connection, a child process emits an event when it exits. All objects which emit events are are instances of node.EventEmitter.

-

Events are represented by a snakecased string. Here are some examples: -"connection", "receive", "message_begin".

+

Events are represented by a camel-cased string. Here are some examples: +"connection", "receive", "messageBegin".

Functions can be then be attached to objects, to be executed when an event is emitted. These functions are called listeners.

Some asynchronous file operations return an EventEmitter called a @@ -588,8 +588,8 @@ cellspacing="0" cellpadding="4"> -Event -Parameters + Event + Parameters Notes @@ -597,22 +597,27 @@ cellspacing="0" cellpadding="4">

"output"

data

-

Each time the child process sends data to its stdout, this event is -emitted. data is a string.
-If the child process closes its stdout stream (a common thing to do on -exit), this event will be emitted with data === null.

+

Each time the child process + sends data to its stdout, this event is + emitted. data is a string. + If the child + process closes its stdout stream (a common + thing to do on exit), this event will be emitted + with data === null.

"error"

data

-

Identical to the "output" event except for stderr instead of stdout.

+

Identical to the "output" event except for + stderr instead of stdout.

"exit"

code

-

This event is emitted after the child process ends. code is the final exit -code of the process. One can be assured that after this event is emitted -that the "output" and "error" callbacks will no longer be made.

+

This event is emitted after the child process + ends. code is the final exit code of the + process. One can be assured that after this + event is emitted that the "output" and + "error" callbacks will no longer be made.

@@ -999,9 +1004,7 @@ user is able to stream data.

In order to support the full spectrum of possible HTTP applications, Node’s HTTP API is very low-level. It deals with connection handling and message parsing only. It parses a message into headers and body but it does not -parse the actual headers or the body. That means, for example, that Node -does not, and will never, provide API to access or manipulate Cookies or -multi-part bodies. This is left to the user.

+parse the actual headers or the body.

http.Server

- + @@ -1022,24 +1025,27 @@ cellspacing="0" cellpadding="4"> - + + connection is an object of type + http.Connection. Usually users + will not want to access this event. + The connection can also be + accessed at request.connection.

+ is an integer which indicates what, if any, + error caused the server to close. If no + error occured errorno will be 0.

Event Parameters Parameters Notes

"request"

request, response

request is an instance of http.ServerRequest
-response is an instance of http.ServerResponse

request is an instance of http.ServerRequest +
+ response is an instance of http.ServerResponse

"connection"

connection

When a new TCP connection is established. -connection is an object of type http.Connection. Usually users will not -want to access this event. The connection can also be accessed at -request.connection.

"close"

errorno

Emitted when the server closes. errorno - is an integer which indicates what, if any, - error caused the server to close. If no - error occured errorno will be 0.

@@ -1099,16 +1105,20 @@ cellspacing="0" cellpadding="4">

"body"

chunk

-

Emitted when a piece of the message body is received. Example: A chunk of -the body is given as the single argument. The transfer-encoding has been -decoded. The body chunk is a String. The body encoding is set -with request.setBodyEncoding().

+

Emitted when a piece of the + message body is received. Example: A chunk + of the body is given as the single + argument. The transfer-encoding has been + decoded. The body chunk is a String. The + body encoding is set with + request.setBodyEncoding().

"complete"

-

-

Emitted exactly once for each message. No arguments. -After emitted no other events will be emitted on the request.

+

(none)

+

Emitted exactly once for each message. + No arguments. After emitted no other + events will be emitted on the request.

@@ -1134,7 +1144,7 @@ present in the actual HTTP request. That is, if the request is
GET /status?name=ryan HTTP/1.1\r\n
-Accept: */*\r\n
+Accept: text/plain\r\n
 \r\n

Then request.uri will be

@@ -1149,7 +1159,12 @@ Accept: */*\r\n

In particular, note that request.uri.protocol is undefined. This is because there was no URI protocol given in the actual HTTP Request.

-

request.uri.anchor, request.uri.query, request.uri.file, request.uri.directory, request.uri.path, request.uri.relative, request.uri.port, request.uri.host, request.uri.password, request.uri.user, request.uri.authority, request.uri.protocol, request.uri.params, request.uri.toString(), request.uri.source

+

Here is what’s available: request.uri.anchor, request.uri.query, +request.uri.file, request.uri.directory, request.uri.path, +request.uri.relative, request.uri.port, request.uri.host, +request.uri.password, request.uri.user, request.uri.authority, +request.uri.protocol, request.uri.params, request.uri.toString(), +request.uri.source

request.headers @@ -2015,7 +2030,7 @@ init (Handle<Object> target) diff --git a/doc/api.txt b/doc/api.txt index 2b71cf3a0cf..1da911ad2c0 100644 --- a/doc/api.txt +++ b/doc/api.txt @@ -136,8 +136,8 @@ Many objects in Node emit events: a TCP server emits an event each time there is a connection, a child process emits an event when it exits. All objects which emit events are are instances of +node.EventEmitter+. -Events are represented by a snakecased string. Here are some examples: -+"connection"+, +"receive"+, +"message_begin"+. +Events are represented by a camel-cased string. Here are some examples: ++"connection"+, +"receive"+, +"messageBegin"+. Functions can be then be attached to objects, to be executed when an event is emitted. These functions are called _listeners_. @@ -368,24 +368,23 @@ Node provides a tridirectional +popen(3)+ facility through the class [cols="1,2,10",options="header"] |========================================================= -|Event |Parameters |Notes +| Event | Parameters |Notes -|+"output"+ | +data+ | -Each time the child process sends data to its +stdout+, this event is -emitted. +data+ is a string. -+ -If the child process closes its +stdout+ stream (a common thing to do on -exit), this event will be emitted with +data === null+. +| +"output"+ | +data+ | Each time the child process + sends data to its +stdout+, this event is + emitted. +data+ is a string. + If the child + process closes its +stdout+ stream (a common + thing to do on exit), this event will be emitted + with +data === null+. +| +"error"+ | +data+ | Identical to the +"output"+ event except for + +stderr+ instead of +stdout+. -|+"error"+ | +data+ | -Identical to the +"output"+ event except for +stderr+ instead of +stdout+. - -|+"exit"+ | +code+ | -This event is emitted after the child process ends. +code+ is the final exit -code of the process. One can be assured that after this event is emitted -that the +"output"+ and +"error"+ callbacks will no longer be made. - +| +"exit"+ | +code+ | This event is emitted after the child process + ends. +code+ is the final exit code of the + process. One can be assured that after this + event is emitted that the +"output"+ and + +"error"+ callbacks will no longer be made. |========================================================= +node.createChildProcess(command)+:: @@ -594,32 +593,30 @@ HTTP message headers are represented by an object like this In order to support the full spectrum of possible HTTP applications, Node's HTTP API is very low-level. It deals with connection handling and message parsing only. It parses a message into headers and body but it does not -parse the actual headers or the body. That means, for example, that Node -does not, and will never, provide API to access or manipulate Cookies or -multi-part bodies. _This is left to the user._ +parse the actual headers or the body. ==== +http.Server+ [cols="1,2,10",options="header"] |========================================================= -|Event | Parameters | Notes +|Event | Parameters | Notes -|+"request"+ | +request, response+ | -+request+ is an instance of +http.ServerRequest+ -+ -+response+ is an instance of +http.ServerResponse+ +|+"request"+ | +request, response+ | +request+ is an instance of +http.ServerRequest+ + + + +response+ is an instance of +http.ServerResponse+ -|+"connection"+ | +connection+ | -When a new TCP connection is established. -+connection+ is an object of type +http.Connection+. Usually users will not -want to access this event. The +connection+ can also be accessed at -+request.connection+. +|+"connection"+ | +connection+ | When a new TCP connection is established. + +connection+ is an object of type + +http.Connection+. Usually users + will not want to access this event. + The +connection+ can also be + accessed at +request.connection+. -|+"close"+ | +errorno+ | Emitted when the server closes. +errorno+ - is an integer which indicates what, if any, - error caused the server to close. If no - error occured +errorno+ will be 0. +|+"close"+ | +errorno+ | Emitted when the server closes. +errorno+ + is an integer which indicates what, if any, + error caused the server to close. If no + error occured +errorno+ will be 0. |========================================================= @@ -652,16 +649,17 @@ the user--and passed as the first argument to a +"request"+ listener. |========================================================= |Event | Parameters | Notes -|+"body"+ | +chunk+ | -Emitted when a piece of the message body is received. Example: A chunk of -the body is given as the single argument. The transfer-encoding has been -decoded. The body chunk is a String. The body encoding is set -with +request.setBodyEncoding()+. - -|+"complete"+ | | -Emitted exactly once for each message. No arguments. -After emitted no other events will be emitted on the request. +|+"body"+ | +chunk+ | Emitted when a piece of the + message body is received. Example: A chunk + of the body is given as the single + argument. The transfer-encoding has been + decoded. The body chunk is a String. The + body encoding is set with + +request.setBodyEncoding()+. +|+"complete"+ | (none) | Emitted exactly once for each message. + No arguments. After emitted no other + events will be emitted on the request. |========================================================= +request.method+ :: @@ -675,7 +673,7 @@ present in the actual HTTP request. That is, if the request is + ---------------------------------------- GET /status?name=ryan HTTP/1.1\r\n -Accept: */*\r\n +Accept: text/plain\r\n \r\n ---------------------------------------- + @@ -693,7 +691,12 @@ In particular, note that +request.uri.protocol+ is +undefined+. This is because there was no URI protocol given in the actual HTTP Request. + -+request.uri.anchor+, +request.uri.query+, +request.uri.file+, +request.uri.directory+, +request.uri.path+, +request.uri.relative+, +request.uri.port+, +request.uri.host+, +request.uri.password+, +request.uri.user+, +request.uri.authority+, +request.uri.protocol+, +request.uri.params+, +request.uri.toString()+, +request.uri.source+ +Here is what's available: +request.uri.anchor+, +request.uri.query+, ++request.uri.file+, +request.uri.directory+, +request.uri.path+, ++request.uri.relative+, +request.uri.port+, +request.uri.host+, ++request.uri.password+, +request.uri.user+, +request.uri.authority+, ++request.uri.protocol+, +request.uri.params+, +request.uri.toString()+, ++request.uri.source+ +request.headers+ :: diff --git a/doc/api.xml b/doc/api.xml index ac1fbc26e9f..e3b8399c5a9 100644 --- a/doc/api.xml +++ b/doc/api.xml @@ -242,8 +242,8 @@ on error: exit code, stdout buffer, stderr buffer Many objects in Node emit events: a TCP server emits an event each time there is a connection, a child process emits an event when it exits. All objects which emit events are are instances of node.EventEmitter. -Events are represented by a snakecased string. Here are some examples: -"connection", "receive", "message_begin". +Events are represented by a camel-cased string. Here are some examples: +"connection", "receive", "messageBegin". Functions can be then be attached to objects, to be executed when an event is emitted. These functions are called listeners. Some asynchronous file operations return an EventEmitter called a @@ -620,8 +620,8 @@ rowsep="1" colsep="1" -Event -Parameters + Event + Parameters Notes @@ -629,22 +629,27 @@ rowsep="1" colsep="1" "output" data -Each time the child process sends data to its stdout, this event is -emitted. data is a string. -If the child process closes its stdout stream (a common thing to do on -exit), this event will be emitted with data === null. +Each time the child process + sends data to its stdout, this event is + emitted. data is a string. + If the child + process closes its stdout stream (a common + thing to do on exit), this event will be emitted + with data === null. "error" data -Identical to the "output" event except for stderr instead of stdout. +Identical to the "output" event except for + stderr instead of stdout. "exit" code -This event is emitted after the child process ends. code is the final exit -code of the process. One can be assured that after this event is emitted -that the "output" and "error" callbacks will no longer be made. +This event is emitted after the child process + ends. code is the final exit code of the + process. One can be assured that after this + event is emitted that the "output" and + "error" callbacks will no longer be made. @@ -1051,9 +1056,7 @@ user is able to stream data. In order to support the full spectrum of possible HTTP applications, Node’s HTTP API is very low-level. It deals with connection handling and message parsing only. It parses a message into headers and body but it does not -parse the actual headers or the body. That means, for example, that Node -does not, and will never, provide API to access or manipulate Cookies or -multi-part bodies. This is left to the user. +parse the actual headers or the body. <literal>http.Server</literal> Event - Parameters + Parameters Notes @@ -1075,24 +1078,27 @@ rowsep="1" colsep="1" "request" request, response -request is an instance of http.ServerRequest -response is an instance of http.ServerResponse +request is an instance of http.ServerRequest + + response is an instance of http.ServerResponse "connection" connection When a new TCP connection is established. -connection is an object of type http.Connection. Usually users will not -want to access this event. The connection can also be accessed at -request.connection. + connection is an object of type + http.Connection. Usually users + will not want to access this event. + The connection can also be + accessed at request.connection. "close" errorno Emitted when the server closes. errorno - is an integer which indicates what, if any, - error caused the server to close. If no - error occured errorno will be 0. + is an integer which indicates what, if any, + error caused the server to close. If no + error occured errorno will be 0. @@ -1160,16 +1166,20 @@ rowsep="1" colsep="1" "body" chunk -Emitted when a piece of the message body is received. Example: A chunk of -the body is given as the single argument. The transfer-encoding has been -decoded. The body chunk is a String. The body encoding is set -with request.setBodyEncoding(). +Emitted when a piece of the + message body is received. Example: A chunk + of the body is given as the single + argument. The transfer-encoding has been + decoded. The body chunk is a String. The + body encoding is set with + request.setBodyEncoding(). "complete" - -Emitted exactly once for each message. No arguments. -After emitted no other events will be emitted on the request. +(none) +Emitted exactly once for each message. + No arguments. After emitted no other + events will be emitted on the request. @@ -1196,7 +1206,7 @@ Request URI Object. This contains only the parameters that are present in the actual HTTP request. That is, if the request is GET /status?name=ryan HTTP/1.1\r\n -Accept: */*\r\n +Accept: text/plain\r\n \r\n Then request.uri will be { path: "/status", @@ -1207,7 +1217,12 @@ Accept: */*\r\n In particular, note that request.uri.protocol is undefined. This is because there was no URI protocol given in the actual HTTP Request. -request.uri.anchor, request.uri.query, request.uri.file, request.uri.directory, request.uri.path, request.uri.relative, request.uri.port, request.uri.host, request.uri.password, request.uri.user, request.uri.authority, request.uri.protocol, request.uri.params, request.uri.toString(), request.uri.source +Here is what’s available: request.uri.anchor, request.uri.query, +request.uri.file, request.uri.directory, request.uri.path, +request.uri.relative, request.uri.port, request.uri.host, +request.uri.password, request.uri.user, request.uri.authority, +request.uri.protocol, request.uri.params, request.uri.toString(), +request.uri.source diff --git a/doc/node.1 b/doc/node.1 index 5edc3a32f3b..286e156bc7b 100644 --- a/doc/node.1 +++ b/doc/node.1 @@ -1,11 +1,11 @@ .\" Title: node .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 09/28/2009 +.\" Date: 09/29/2009 .\" Manual: .\" Source: .\" -.TH "NODE" "1" "09/28/2009" "" "" +.TH "NODE" "1" "09/29/2009" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -170,7 +170,7 @@ exec("ls /")\.addCallback(function (stdout, stderr) { .SS "Events" Many objects in Node emit events: a TCP server emits an event each time there is a connection, a child process emits an event when it exits\. All objects which emit events are are instances of node\.EventEmitter\. .sp -Events are represented by a snakecased string\. Here are some examples: "connection", "receive", "message_begin"\. +Events are represented by a camel\-cased string\. Here are some examples: "connection", "receive", "messageBegin"\. .sp Functions can be then be attached to objects, to be executed when an event is emitted\. These functions are called \fIlisteners\fR\. .sp @@ -519,7 +519,7 @@ T}:T{ data .sp T}:T{ -Each time the child process sends data to its stdout, this event is emitted\. data is a string\. If the child process closes its stdout stream (a common thing to do on exit), this event will be emitted with data === null\. +Each time the child process sends data to its stdout, this event is emitted\. data is a string\. + If the child process closes its stdout stream (a common thing to do on exit), this event will be emitted with data === null\. .sp T} T{ @@ -847,7 +847,7 @@ HTTP message headers are represented by an object like this } .fi .RE -In order to support the full spectrum of possible HTTP applications, Node\(cqs HTTP API is very low\-level\. It deals with connection handling and message parsing only\. It parses a message into headers and body but it does not parse the actual headers or the body\. That means, for example, that Node does not, and will never, provide API to access or manipulate Cookies or multi\-part bodies\. \fIThis is left to the user\.\fR +In order to support the full spectrum of possible HTTP applications, Node\(cqs HTTP API is very low\-level\. It deals with connection handling and message parsing only\. It parses a message into headers and body but it does not parse the actual headers or the body\. .sp .sp .it 1 an-trap @@ -967,6 +967,7 @@ T{ "complete" .sp T}:T{ +(none) .sp T}:T{ Emitted exactly once for each message\. No arguments\. After emitted no other events will be emitted on the request\. @@ -988,7 +989,7 @@ Request URI Object\. This contains only the parameters that are present in the a .RS 4 .nf GET /status?name=ryan HTTP/1\.1\er\en -Accept: */*\er\en +Accept: text/plain\er\en \er\en .fi .RE @@ -1010,6 +1011,7 @@ request\.uri\.protocol is undefined\. This is because there was no URI protocol given in the actual HTTP Request\. .sp +Here is what\(cqs available: request\.uri\.anchor, request\.uri\.query, request\.uri\.file,