Browse Source

Clean up some text in documentation.

v0.7.4-release
Ryan Dahl 15 years ago
parent
commit
1ae69a68a4
  1. 69
      doc/api.html
  2. 83
      doc/api.txt
  3. 67
      doc/api.xml
  4. 14
      doc/node.1

69
doc/api.html

@ -240,8 +240,8 @@ on error: exit code, stdout buffer, stderr buffer
<div class="paragraph"><p>Many objects in Node emit events: a TCP server emits an event each time <div class="paragraph"><p>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 there is a connection, a child process emits an event when it exits. All
objects which emit events are are instances of <tt>node.EventEmitter</tt>.</p></div> objects which emit events are are instances of <tt>node.EventEmitter</tt>.</p></div>
<div class="paragraph"><p>Events are represented by a snakecased string. Here are some examples: <div class="paragraph"><p>Events are represented by a camel-cased string. Here are some examples:
<tt>"connection"</tt>, <tt>"receive"</tt>, <tt>"message_begin"</tt>.</p></div> <tt>"connection"</tt>, <tt>"receive"</tt>, <tt>"messageBegin"</tt>.</p></div>
<div class="paragraph"><p>Functions can be then be attached to objects, to be executed when an event <div class="paragraph"><p>Functions can be then be attached to objects, to be executed when an event
is emitted. These functions are called <em>listeners</em>.</p></div> is emitted. These functions are called <em>listeners</em>.</p></div>
<div class="paragraph"><p>Some asynchronous file operations return an <tt>EventEmitter</tt> called a <div class="paragraph"><p>Some asynchronous file operations return an <tt>EventEmitter</tt> called a
@ -597,22 +597,27 @@ cellspacing="0" cellpadding="4">
<tr> <tr>
<td align="left" valign="top"><p class="table"><tt>"output"</tt></p></td> <td align="left" valign="top"><p class="table"><tt>"output"</tt></p></td>
<td align="left" valign="top"><p class="table"><tt>data</tt></p></td> <td align="left" valign="top"><p class="table"><tt>data</tt></p></td>
<td align="left" valign="top"><p class="table">Each time the child process sends data to its <tt>stdout</tt>, this event is <td align="left" valign="top"><p class="table">Each time the child process
emitted. <tt>data</tt> is a string.<br /> sends data to its <tt>stdout</tt>, this event is
If the child process closes its <tt>stdout</tt> stream (a common thing to do on emitted. <tt>data</tt> is a string. + If the child
exit), this event will be emitted with <tt>data === null</tt>.</p></td> process closes its <tt>stdout</tt> stream (a common
thing to do on exit), this event will be emitted
with <tt>data === null</tt>.</p></td>
</tr> </tr>
<tr> <tr>
<td align="left" valign="top"><p class="table"><tt>"error"</tt></p></td> <td align="left" valign="top"><p class="table"><tt>"error"</tt></p></td>
<td align="left" valign="top"><p class="table"><tt>data</tt></p></td> <td align="left" valign="top"><p class="table"><tt>data</tt></p></td>
<td align="left" valign="top"><p class="table">Identical to the <tt>"output"</tt> event except for <tt>stderr</tt> instead of <tt>stdout</tt>.</p></td> <td align="left" valign="top"><p class="table">Identical to the <tt>"output"</tt> event except for
<tt>stderr</tt> instead of <tt>stdout</tt>.</p></td>
</tr> </tr>
<tr> <tr>
<td align="left" valign="top"><p class="table"><tt>"exit"</tt></p></td> <td align="left" valign="top"><p class="table"><tt>"exit"</tt></p></td>
<td align="left" valign="top"><p class="table"><tt>code</tt></p></td> <td align="left" valign="top"><p class="table"><tt>code</tt></p></td>
<td align="left" valign="top"><p class="table">This event is emitted after the child process ends. <tt>code</tt> is the final exit <td align="left" valign="top"><p class="table">This event is emitted after the child process
code of the process. One can be assured that after this event is emitted ends. <tt>code</tt> is the final exit code of the
that the <tt>"output"</tt> and <tt>"error"</tt> callbacks will no longer be made.</p></td> process. One can be assured that after this
event is emitted that the <tt>"output"</tt> and
<tt>"error"</tt> callbacks will no longer be made.</p></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -999,9 +1004,7 @@ user is able to stream data.</p></div>
<div class="paragraph"><p>In order to support the full spectrum of possible HTTP applications, Node&#8217;s <div class="paragraph"><p>In order to support the full spectrum of possible HTTP applications, Node&#8217;s
HTTP API is very low-level. It deals with connection handling and message 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 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 parse the actual headers or the body.</p></div>
does not, and will never, provide API to access or manipulate Cookies or
multi-part bodies. <em>This is left to the user.</em></p></div>
<h4 id="_tt_http_server_tt"><tt>http.Server</tt></h4> <h4 id="_tt_http_server_tt"><tt>http.Server</tt></h4>
<div class="tableblock"> <div class="tableblock">
<table rules="all" <table rules="all"
@ -1022,16 +1025,19 @@ cellspacing="0" cellpadding="4">
<tr> <tr>
<td align="left" valign="top"><p class="table"><tt>"request"</tt></p></td> <td align="left" valign="top"><p class="table"><tt>"request"</tt></p></td>
<td align="left" valign="top"><p class="table"><tt>request, response</tt></p></td> <td align="left" valign="top"><p class="table"><tt>request, response</tt></p></td>
<td align="left" valign="top"><p class="table"><tt>request</tt> is an instance of <tt>http.ServerRequest</tt><br /> <td align="left" valign="top"><p class="table"><tt>request</tt> is an instance of <tt>http.ServerRequest</tt>
<br />
<tt>response</tt> is an instance of <tt>http.ServerResponse</tt></p></td> <tt>response</tt> is an instance of <tt>http.ServerResponse</tt></p></td>
</tr> </tr>
<tr> <tr>
<td align="left" valign="top"><p class="table"><tt>"connection"</tt></p></td> <td align="left" valign="top"><p class="table"><tt>"connection"</tt></p></td>
<td align="left" valign="top"><p class="table"><tt>connection</tt></p></td> <td align="left" valign="top"><p class="table"><tt>connection</tt></p></td>
<td align="left" valign="top"><p class="table">When a new TCP connection is established. <td align="left" valign="top"><p class="table">When a new TCP connection is established.
<tt>connection</tt> is an object of type <tt>http.Connection</tt>. Usually users will not <tt>connection</tt> is an object of type
want to access this event. The <tt>connection</tt> can also be accessed at <tt>http.Connection</tt>. Usually users
<tt>request.connection</tt>.</p></td> will not want to access this event.
The <tt>connection</tt> can also be
accessed at <tt>request.connection</tt>.</p></td>
</tr> </tr>
<tr> <tr>
<td align="left" valign="top"><p class="table"><tt>"close"</tt></p></td> <td align="left" valign="top"><p class="table"><tt>"close"</tt></p></td>
@ -1099,16 +1105,20 @@ cellspacing="0" cellpadding="4">
<tr> <tr>
<td align="left" valign="top"><p class="table"><tt>"body"</tt></p></td> <td align="left" valign="top"><p class="table"><tt>"body"</tt></p></td>
<td align="left" valign="top"><p class="table"><tt>chunk</tt></p></td> <td align="left" valign="top"><p class="table"><tt>chunk</tt></p></td>
<td align="left" valign="top"><p class="table">Emitted when a piece of the message body is received. Example: A chunk of <td align="left" valign="top"><p class="table">Emitted when a piece of the
the body is given as the single argument. The transfer-encoding has been message body is received. Example: A chunk
decoded. The body chunk is a String. The body encoding is set of the body is given as the single
with <tt>request.setBodyEncoding()</tt>.</p></td> argument. The transfer-encoding has been
decoded. The body chunk is a String. The
body encoding is set with
<tt>request.setBodyEncoding()</tt>.</p></td>
</tr> </tr>
<tr> <tr>
<td align="left" valign="top"><p class="table"><tt>"complete"</tt></p></td> <td align="left" valign="top"><p class="table"><tt>"complete"</tt></p></td>
<td align="left" valign="top"><p class="table"></p></td> <td align="left" valign="top"><p class="table">(none)</p></td>
<td align="left" valign="top"><p class="table">Emitted exactly once for each message. No arguments. <td align="left" valign="top"><p class="table">Emitted exactly once for each message.
After emitted no other events will be emitted on the request.</p></td> No arguments. After emitted no other
events will be emitted on the request.</p></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -1134,7 +1144,7 @@ present in the actual HTTP request. That is, if the request is
<div class="listingblock"> <div class="listingblock">
<div class="content"> <div class="content">
<pre><tt>GET /status?name=ryan HTTP/1.1\r\n <pre><tt>GET /status?name=ryan HTTP/1.1\r\n
Accept: */*\r\n Accept: text/plain\r\n
\r\n</tt></pre> \r\n</tt></pre>
</div></div> </div></div>
<div class="paragraph"><p>Then <tt>request.uri</tt> will be</p></div> <div class="paragraph"><p>Then <tt>request.uri</tt> will be</p></div>
@ -1149,7 +1159,12 @@ Accept: */*\r\n
<div class="paragraph"><p>In particular, note that <tt>request.uri.protocol</tt> is <div class="paragraph"><p>In particular, note that <tt>request.uri.protocol</tt> is
<tt>undefined</tt>. This is because there was no URI protocol given <tt>undefined</tt>. This is because there was no URI protocol given
in the actual HTTP Request.</p></div> in the actual HTTP Request.</p></div>
<div class="paragraph"><p><tt>request.uri.anchor</tt>, <tt>request.uri.query</tt>, <tt>request.uri.file</tt>, <tt>request.uri.directory</tt>, <tt>request.uri.path</tt>, <tt>request.uri.relative</tt>, <tt>request.uri.port</tt>, <tt>request.uri.host</tt>, <tt>request.uri.password</tt>, <tt>request.uri.user</tt>, <tt>request.uri.authority</tt>, <tt>request.uri.protocol</tt>, <tt>request.uri.params</tt>, <tt>request.uri.toString()</tt>, <tt>request.uri.source</tt></p></div> <div class="paragraph"><p>Here is what&#8217;s available: <tt>request.uri.anchor</tt>, <tt>request.uri.query</tt>,
<tt>request.uri.file</tt>, <tt>request.uri.directory</tt>, <tt>request.uri.path</tt>,
<tt>request.uri.relative</tt>, <tt>request.uri.port</tt>, <tt>request.uri.host</tt>,
<tt>request.uri.password</tt>, <tt>request.uri.user</tt>, <tt>request.uri.authority</tt>,
<tt>request.uri.protocol</tt>, <tt>request.uri.params</tt>, <tt>request.uri.toString()</tt>,
<tt>request.uri.source</tt></p></div>
</dd> </dd>
<dt class="hdlist1"> <dt class="hdlist1">
<tt>request.headers</tt> <tt>request.headers</tt>
@ -2015,7 +2030,7 @@ init (Handle&lt;Object&gt; target)
<div id="footer"> <div id="footer">
<div id="footer-text"> <div id="footer-text">
Version 0.1.12<br /> Version 0.1.12<br />
Last updated 2009-09-28 21:50:11 CEST Last updated 2009-09-29 09:59:52 CEST
</div> </div>
</div> </div>
</body> </body>

83
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 there is a connection, a child process emits an event when it exits. All
objects which emit events are are instances of +node.EventEmitter+. objects which emit events are are instances of +node.EventEmitter+.
Events are represented by a snakecased string. Here are some examples: Events are represented by a camel-cased string. Here are some examples:
+"connection"+, +"receive"+, +"message_begin"+. +"connection"+, +"receive"+, +"messageBegin"+.
Functions can be then be attached to objects, to be executed when an event Functions can be then be attached to objects, to be executed when an event
is emitted. These functions are called _listeners_. is emitted. These functions are called _listeners_.
@ -370,22 +370,21 @@ Node provides a tridirectional +popen(3)+ facility through the class
|========================================================= |=========================================================
| Event | Parameters |Notes | Event | Parameters |Notes
|+"output"+ | +data+ | | +"output"+ | +data+ | Each time the child process
Each time the child process sends data to its +stdout+, this event is sends data to its +stdout+, this event is
emitted. +data+ is a string. emitted. +data+ is a string. + If the child
+ process closes its +stdout+ stream (a common
If the child process closes its +stdout+ stream (a common thing to do on thing to do on exit), this event will be emitted
exit), this event will be emitted with +data === null+. with +data === null+.
| +"error"+ | +data+ | Identical to the +"output"+ event except for
|+"error"+ | +data+ | +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
|+"exit"+ | +code+ | ends. +code+ is the final exit code of the
This event is emitted after the child process ends. +code+ is the final exit process. One can be assured that after this
code of the process. One can be assured that after this event is emitted event is emitted that the +"output"+ and
that the +"output"+ and +"error"+ callbacks will no longer be made. +"error"+ callbacks will no longer be made.
|========================================================= |=========================================================
+node.createChildProcess(command)+:: +node.createChildProcess(command)+::
@ -594,9 +593,7 @@ HTTP message headers are represented by an object like this
In order to support the full spectrum of possible HTTP applications, Node's 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 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 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 parse the actual headers or the body.
does not, and will never, provide API to access or manipulate Cookies or
multi-part bodies. _This is left to the user._
==== +http.Server+ ==== +http.Server+
@ -605,16 +602,16 @@ multi-part bodies. _This is left to the user._
|========================================================= |=========================================================
|Event | Parameters | Notes |Event | Parameters | Notes
|+"request"+ | +request, response+ | |+"request"+ | +request, response+ | +request+ is an instance of +http.ServerRequest+
+request+ is an instance of +http.ServerRequest+
+ +
+response+ is an instance of +http.ServerResponse+ +response+ is an instance of +http.ServerResponse+
|+"connection"+ | +connection+ | |+"connection"+ | +connection+ | When a new TCP connection is established.
When a new TCP connection is established. +connection+ is an object of type
+connection+ is an object of type +http.Connection+. Usually users will not +http.Connection+. Usually users
want to access this event. The +connection+ can also be accessed at will not want to access this event.
+request.connection+. The +connection+ can also be
accessed at +request.connection+.
|+"close"+ | +errorno+ | Emitted when the server closes. +errorno+ |+"close"+ | +errorno+ | Emitted when the server closes. +errorno+
is an integer which indicates what, if any, is an integer which indicates what, if any,
@ -652,16 +649,17 @@ the user--and passed as the first argument to a +"request"+ listener.
|========================================================= |=========================================================
|Event | Parameters | Notes |Event | Parameters | Notes
|+"body"+ | +chunk+ | |+"body"+ | +chunk+ | Emitted when a piece of the
Emitted when a piece of the message body is received. Example: A chunk of message body is received. Example: A chunk
the body is given as the single argument. The transfer-encoding has been of the body is given as the single
decoded. The body chunk is a String. The body encoding is set argument. The transfer-encoding has been
with +request.setBodyEncoding()+. decoded. The body chunk is a String. The
body encoding is set with
|+"complete"+ | | +request.setBodyEncoding()+.
Emitted exactly once for each message. No arguments.
After emitted no other events will be emitted on the request. |+"complete"+ | (none) | Emitted exactly once for each message.
No arguments. After emitted no other
events will be emitted on the request.
|========================================================= |=========================================================
+request.method+ :: +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 GET /status?name=ryan HTTP/1.1\r\n
Accept: */*\r\n Accept: text/plain\r\n
\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 +undefined+. This is because there was no URI protocol given
in the actual HTTP Request. 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+ :: +request.headers+ ::

67
doc/api.xml

@ -242,8 +242,8 @@ on error: exit code, stdout buffer, stderr buffer
<simpara>Many objects in Node emit events: a TCP server emits an event each time <simpara>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 there is a connection, a child process emits an event when it exits. All
objects which emit events are are instances of <literal>node.EventEmitter</literal>.</simpara> objects which emit events are are instances of <literal>node.EventEmitter</literal>.</simpara>
<simpara>Events are represented by a snakecased string. Here are some examples: <simpara>Events are represented by a camel-cased string. Here are some examples:
<literal>"connection"</literal>, <literal>"receive"</literal>, <literal>"message_begin"</literal>.</simpara> <literal>"connection"</literal>, <literal>"receive"</literal>, <literal>"messageBegin"</literal>.</simpara>
<simpara>Functions can be then be attached to objects, to be executed when an event <simpara>Functions can be then be attached to objects, to be executed when an event
is emitted. These functions are called <emphasis>listeners</emphasis>.</simpara> is emitted. These functions are called <emphasis>listeners</emphasis>.</simpara>
<simpara>Some asynchronous file operations return an <literal>EventEmitter</literal> called a <simpara>Some asynchronous file operations return an <literal>EventEmitter</literal> called a
@ -629,22 +629,27 @@ rowsep="1" colsep="1"
<row> <row>
<entry align="left" valign="top"><simpara><literal>"output"</literal></simpara></entry> <entry align="left" valign="top"><simpara><literal>"output"</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>data</literal></simpara></entry> <entry align="left" valign="top"><simpara><literal>data</literal></simpara></entry>
<entry align="left" valign="top"><simpara>Each time the child process sends data to its <literal>stdout</literal>, this event is <entry align="left" valign="top"><simpara>Each time the child process
emitted. <literal>data</literal> is a string.<?asciidoc-br?> sends data to its <literal>stdout</literal>, this event is
If the child process closes its <literal>stdout</literal> stream (a common thing to do on emitted. <literal>data</literal> is a string. + If the child
exit), this event will be emitted with <literal>data === null</literal>.</simpara></entry> process closes its <literal>stdout</literal> stream (a common
thing to do on exit), this event will be emitted
with <literal>data === null</literal>.</simpara></entry>
</row> </row>
<row> <row>
<entry align="left" valign="top"><simpara><literal>"error"</literal></simpara></entry> <entry align="left" valign="top"><simpara><literal>"error"</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>data</literal></simpara></entry> <entry align="left" valign="top"><simpara><literal>data</literal></simpara></entry>
<entry align="left" valign="top"><simpara>Identical to the <literal>"output"</literal> event except for <literal>stderr</literal> instead of <literal>stdout</literal>.</simpara></entry> <entry align="left" valign="top"><simpara>Identical to the <literal>"output"</literal> event except for
<literal>stderr</literal> instead of <literal>stdout</literal>.</simpara></entry>
</row> </row>
<row> <row>
<entry align="left" valign="top"><simpara><literal>"exit"</literal></simpara></entry> <entry align="left" valign="top"><simpara><literal>"exit"</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>code</literal></simpara></entry> <entry align="left" valign="top"><simpara><literal>code</literal></simpara></entry>
<entry align="left" valign="top"><simpara>This event is emitted after the child process ends. <literal>code</literal> is the final exit <entry align="left" valign="top"><simpara>This event is emitted after the child process
code of the process. One can be assured that after this event is emitted ends. <literal>code</literal> is the final exit code of the
that the <literal>"output"</literal> and <literal>"error"</literal> callbacks will no longer be made.</simpara></entry> process. One can be assured that after this
event is emitted that the <literal>"output"</literal> and
<literal>"error"</literal> callbacks will no longer be made.</simpara></entry>
</row> </row>
</tbody> </tbody>
</tgroup> </tgroup>
@ -1051,9 +1056,7 @@ user is able to stream data.</simpara>
<simpara>In order to support the full spectrum of possible HTTP applications, Node&#8217;s <simpara>In order to support the full spectrum of possible HTTP applications, Node&#8217;s
HTTP API is very low-level. It deals with connection handling and message 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 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 parse the actual headers or the body.</simpara>
does not, and will never, provide API to access or manipulate Cookies or
multi-part bodies. <emphasis>This is left to the user.</emphasis></simpara>
<refsect3 id="_literal_http_server_literal"> <refsect3 id="_literal_http_server_literal">
<title><literal>http.Server</literal></title> <title><literal>http.Server</literal></title>
<informaltable <informaltable
@ -1075,16 +1078,19 @@ rowsep="1" colsep="1"
<row> <row>
<entry align="left" valign="top"><simpara><literal>"request"</literal></simpara></entry> <entry align="left" valign="top"><simpara><literal>"request"</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>request, response</literal></simpara></entry> <entry align="left" valign="top"><simpara><literal>request, response</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>request</literal> is an instance of <literal>http.ServerRequest</literal><?asciidoc-br?> <entry align="left" valign="top"><simpara><literal>request</literal> is an instance of <literal>http.ServerRequest</literal>
<?asciidoc-br?>
<literal>response</literal> is an instance of <literal>http.ServerResponse</literal></simpara></entry> <literal>response</literal> is an instance of <literal>http.ServerResponse</literal></simpara></entry>
</row> </row>
<row> <row>
<entry align="left" valign="top"><simpara><literal>"connection"</literal></simpara></entry> <entry align="left" valign="top"><simpara><literal>"connection"</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>connection</literal></simpara></entry> <entry align="left" valign="top"><simpara><literal>connection</literal></simpara></entry>
<entry align="left" valign="top"><simpara>When a new TCP connection is established. <entry align="left" valign="top"><simpara>When a new TCP connection is established.
<literal>connection</literal> is an object of type <literal>http.Connection</literal>. Usually users will not <literal>connection</literal> is an object of type
want to access this event. The <literal>connection</literal> can also be accessed at <literal>http.Connection</literal>. Usually users
<literal>request.connection</literal>.</simpara></entry> will not want to access this event.
The <literal>connection</literal> can also be
accessed at <literal>request.connection</literal>.</simpara></entry>
</row> </row>
<row> <row>
<entry align="left" valign="top"><simpara><literal>"close"</literal></simpara></entry> <entry align="left" valign="top"><simpara><literal>"close"</literal></simpara></entry>
@ -1160,16 +1166,20 @@ rowsep="1" colsep="1"
<row> <row>
<entry align="left" valign="top"><simpara><literal>"body"</literal></simpara></entry> <entry align="left" valign="top"><simpara><literal>"body"</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>chunk</literal></simpara></entry> <entry align="left" valign="top"><simpara><literal>chunk</literal></simpara></entry>
<entry align="left" valign="top"><simpara>Emitted when a piece of the message body is received. Example: A chunk of <entry align="left" valign="top"><simpara>Emitted when a piece of the
the body is given as the single argument. The transfer-encoding has been message body is received. Example: A chunk
decoded. The body chunk is a String. The body encoding is set of the body is given as the single
with <literal>request.setBodyEncoding()</literal>.</simpara></entry> argument. The transfer-encoding has been
decoded. The body chunk is a String. The
body encoding is set with
<literal>request.setBodyEncoding()</literal>.</simpara></entry>
</row> </row>
<row> <row>
<entry align="left" valign="top"><simpara><literal>"complete"</literal></simpara></entry> <entry align="left" valign="top"><simpara><literal>"complete"</literal></simpara></entry>
<entry align="left" valign="top"><simpara></simpara></entry> <entry align="left" valign="top"><simpara>(none)</simpara></entry>
<entry align="left" valign="top"><simpara>Emitted exactly once for each message. No arguments. <entry align="left" valign="top"><simpara>Emitted exactly once for each message.
After emitted no other events will be emitted on the request.</simpara></entry> No arguments. After emitted no other
events will be emitted on the request.</simpara></entry>
</row> </row>
</tbody> </tbody>
</tgroup> </tgroup>
@ -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 present in the actual HTTP request. That is, if the request is
</simpara> </simpara>
<screen>GET /status?name=ryan HTTP/1.1\r\n <screen>GET /status?name=ryan HTTP/1.1\r\n
Accept: */*\r\n Accept: text/plain\r\n
\r\n</screen> \r\n</screen>
<simpara>Then <literal>request.uri</literal> will be</simpara> <simpara>Then <literal>request.uri</literal> will be</simpara>
<screen>{ path: "/status", <screen>{ path: "/status",
@ -1207,7 +1217,12 @@ Accept: */*\r\n
<simpara>In particular, note that <literal>request.uri.protocol</literal> is <simpara>In particular, note that <literal>request.uri.protocol</literal> is
<literal>undefined</literal>. This is because there was no URI protocol given <literal>undefined</literal>. This is because there was no URI protocol given
in the actual HTTP Request.</simpara> in the actual HTTP Request.</simpara>
<simpara><literal>request.uri.anchor</literal>, <literal>request.uri.query</literal>, <literal>request.uri.file</literal>, <literal>request.uri.directory</literal>, <literal>request.uri.path</literal>, <literal>request.uri.relative</literal>, <literal>request.uri.port</literal>, <literal>request.uri.host</literal>, <literal>request.uri.password</literal>, <literal>request.uri.user</literal>, <literal>request.uri.authority</literal>, <literal>request.uri.protocol</literal>, <literal>request.uri.params</literal>, <literal>request.uri.toString()</literal>, <literal>request.uri.source</literal></simpara> <simpara>Here is what&#8217;s available: <literal>request.uri.anchor</literal>, <literal>request.uri.query</literal>,
<literal>request.uri.file</literal>, <literal>request.uri.directory</literal>, <literal>request.uri.path</literal>,
<literal>request.uri.relative</literal>, <literal>request.uri.port</literal>, <literal>request.uri.host</literal>,
<literal>request.uri.password</literal>, <literal>request.uri.user</literal>, <literal>request.uri.authority</literal>,
<literal>request.uri.protocol</literal>, <literal>request.uri.params</literal>, <literal>request.uri.toString()</literal>,
<literal>request.uri.source</literal></simpara>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>

14
doc/node.1

@ -1,11 +1,11 @@
.\" Title: node .\" Title: node
.\" Author: .\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/> .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
.\" Date: 09/28/2009 .\" Date: 09/29/2009
.\" Manual: .\" Manual:
.\" Source: .\" Source:
.\" .\"
.TH "NODE" "1" "09/28/2009" "" "" .TH "NODE" "1" "09/29/2009" "" ""
.\" disable hyphenation .\" disable hyphenation
.nh .nh
.\" disable justification (adjust text to left margin only) .\" disable justification (adjust text to left margin only)
@ -170,7 +170,7 @@ exec("ls /")\.addCallback(function (stdout, stderr) {
.SS "Events" .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\. 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 .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 .sp
Functions can be then be attached to objects, to be executed when an event is emitted\. These functions are called \fIlisteners\fR\. Functions can be then be attached to objects, to be executed when an event is emitted\. These functions are called \fIlisteners\fR\.
.sp .sp
@ -519,7 +519,7 @@ T}:T{
data data
.sp .sp
T}:T{ 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 .sp
T} T}
T{ T{
@ -847,7 +847,7 @@ HTTP message headers are represented by an object like this
} }
.fi .fi
.RE .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
.sp .sp
.it 1 an-trap .it 1 an-trap
@ -967,6 +967,7 @@ T{
"complete" "complete"
.sp .sp
T}:T{ T}:T{
(none)
.sp .sp
T}:T{ T}:T{
Emitted exactly once for each message\. No arguments\. After emitted no other events will be emitted on the request\. 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 .RS 4
.nf .nf
GET /status?name=ryan HTTP/1\.1\er\en GET /status?name=ryan HTTP/1\.1\er\en
Accept: */*\er\en Accept: text/plain\er\en
\er\en \er\en
.fi .fi
.RE .RE
@ -1010,6 +1011,7 @@ request\.uri\.protocol
is is
undefined\. This is because there was no URI protocol given in the actual HTTP Request\. undefined\. This is because there was no URI protocol given in the actual HTTP Request\.
.sp .sp
Here is what\(cqs available:
request\.uri\.anchor, request\.uri\.anchor,
request\.uri\.query, request\.uri\.query,
request\.uri\.file, request\.uri\.file,

Loading…
Cancel
Save