Skip to content

Commit 1ae69a6

Browse files
committed
Clean up some text in documentation.
1 parent cda659a commit 1ae69a6

4 files changed

Lines changed: 157 additions & 122 deletions

File tree

doc/api.html

Lines changed: 49 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,8 @@ <h3 id="_events">Events</h3><div style="clear:left"></div>
240240
<div class="paragraph"><p>Many objects in Node emit events: a TCP server emits an event each time
241241
there is a connection, a child process emits an event when it exits. All
242242
objects which emit events are are instances of <tt>node.EventEmitter</tt>.</p></div>
243-
<div class="paragraph"><p>Events are represented by a snakecased string. Here are some examples:
244-
<tt>"connection"</tt>, <tt>"receive"</tt>, <tt>"message_begin"</tt>.</p></div>
243+
<div class="paragraph"><p>Events are represented by a camel-cased string. Here are some examples:
244+
<tt>"connection"</tt>, <tt>"receive"</tt>, <tt>"messageBegin"</tt>.</p></div>
245245
<div class="paragraph"><p>Functions can be then be attached to objects, to be executed when an event
246246
is emitted. These functions are called <em>listeners</em>.</p></div>
247247
<div class="paragraph"><p>Some asynchronous file operations return an <tt>EventEmitter</tt> called a
@@ -588,31 +588,36 @@ <h4 id="_tt_node_childprocess_tt"><tt>node.ChildProcess</tt></h4>
588588
<col width="76%" />
589589
<thead>
590590
<tr>
591-
<th align="left" valign="top">Event </th>
592-
<th align="left" valign="top">Parameters </th>
591+
<th align="left" valign="top"> Event </th>
592+
<th align="left" valign="top"> Parameters </th>
593593
<th align="left" valign="top">Notes</th>
594594
</tr>
595595
</thead>
596596
<tbody>
597597
<tr>
598598
<td align="left" valign="top"><p class="table"><tt>"output"</tt></p></td>
599599
<td align="left" valign="top"><p class="table"><tt>data</tt></p></td>
600-
<td align="left" valign="top"><p class="table">Each time the child process sends data to its <tt>stdout</tt>, this event is
601-
emitted. <tt>data</tt> is a string.<br />
602-
If the child process closes its <tt>stdout</tt> stream (a common thing to do on
603-
exit), this event will be emitted with <tt>data === null</tt>.</p></td>
600+
<td align="left" valign="top"><p class="table">Each time the child process
601+
sends data to its <tt>stdout</tt>, this event is
602+
emitted. <tt>data</tt> is a string. + If the child
603+
process closes its <tt>stdout</tt> stream (a common
604+
thing to do on exit), this event will be emitted
605+
with <tt>data === null</tt>.</p></td>
604606
</tr>
605607
<tr>
606608
<td align="left" valign="top"><p class="table"><tt>"error"</tt></p></td>
607609
<td align="left" valign="top"><p class="table"><tt>data</tt></p></td>
608-
<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>
610+
<td align="left" valign="top"><p class="table">Identical to the <tt>"output"</tt> event except for
611+
<tt>stderr</tt> instead of <tt>stdout</tt>.</p></td>
609612
</tr>
610613
<tr>
611614
<td align="left" valign="top"><p class="table"><tt>"exit"</tt></p></td>
612615
<td align="left" valign="top"><p class="table"><tt>code</tt></p></td>
613-
<td align="left" valign="top"><p class="table">This event is emitted after the child process ends. <tt>code</tt> is the final exit
614-
code of the process. One can be assured that after this event is emitted
615-
that the <tt>"output"</tt> and <tt>"error"</tt> callbacks will no longer be made.</p></td>
616+
<td align="left" valign="top"><p class="table">This event is emitted after the child process
617+
ends. <tt>code</tt> is the final exit code of the
618+
process. One can be assured that after this
619+
event is emitted that the <tt>"output"</tt> and
620+
<tt>"error"</tt> callbacks will no longer be made.</p></td>
616621
</tr>
617622
</tbody>
618623
</table>
@@ -999,9 +1004,7 @@ <h3 id="_http">HTTP</h3><div style="clear:left"></div>
9991004
<div class="paragraph"><p>In order to support the full spectrum of possible HTTP applications, Node&#8217;s
10001005
HTTP API is very low-level. It deals with connection handling and message
10011006
parsing only. It parses a message into headers and body but it does not
1002-
parse the actual headers or the body. That means, for example, that Node
1003-
does not, and will never, provide API to access or manipulate Cookies or
1004-
multi-part bodies. <em>This is left to the user.</em></p></div>
1007+
parse the actual headers or the body.</p></div>
10051008
<h4 id="_tt_http_server_tt"><tt>http.Server</tt></h4>
10061009
<div class="tableblock">
10071010
<table rules="all"
@@ -1014,32 +1017,35 @@ <h4 id="_tt_http_server_tt"><tt>http.Server</tt></h4>
10141017
<thead>
10151018
<tr>
10161019
<th align="left" valign="top">Event </th>
1017-
<th align="left" valign="top"> Parameters </th>
1020+
<th align="left" valign="top"> Parameters </th>
10181021
<th align="left" valign="top"> Notes</th>
10191022
</tr>
10201023
</thead>
10211024
<tbody>
10221025
<tr>
10231026
<td align="left" valign="top"><p class="table"><tt>"request"</tt></p></td>
10241027
<td align="left" valign="top"><p class="table"><tt>request, response</tt></p></td>
1025-
<td align="left" valign="top"><p class="table"><tt>request</tt> is an instance of <tt>http.ServerRequest</tt><br />
1026-
<tt>response</tt> is an instance of <tt>http.ServerResponse</tt></p></td>
1028+
<td align="left" valign="top"><p class="table"><tt>request</tt> is an instance of <tt>http.ServerRequest</tt>
1029+
<br />
1030+
<tt>response</tt> is an instance of <tt>http.ServerResponse</tt></p></td>
10271031
</tr>
10281032
<tr>
10291033
<td align="left" valign="top"><p class="table"><tt>"connection"</tt></p></td>
10301034
<td align="left" valign="top"><p class="table"><tt>connection</tt></p></td>
10311035
<td align="left" valign="top"><p class="table">When a new TCP connection is established.
1032-
<tt>connection</tt> is an object of type <tt>http.Connection</tt>. Usually users will not
1033-
want to access this event. The <tt>connection</tt> can also be accessed at
1034-
<tt>request.connection</tt>.</p></td>
1036+
<tt>connection</tt> is an object of type
1037+
<tt>http.Connection</tt>. Usually users
1038+
will not want to access this event.
1039+
The <tt>connection</tt> can also be
1040+
accessed at <tt>request.connection</tt>.</p></td>
10351041
</tr>
10361042
<tr>
10371043
<td align="left" valign="top"><p class="table"><tt>"close"</tt></p></td>
10381044
<td align="left" valign="top"><p class="table"><tt>errorno</tt></p></td>
10391045
<td align="left" valign="top"><p class="table">Emitted when the server closes. <tt>errorno</tt>
1040-
is an integer which indicates what, if any,
1041-
error caused the server to close. If no
1042-
error occured <tt>errorno</tt> will be 0.</p></td>
1046+
is an integer which indicates what, if any,
1047+
error caused the server to close. If no
1048+
error occured <tt>errorno</tt> will be 0.</p></td>
10431049
</tr>
10441050
</tbody>
10451051
</table>
@@ -1099,16 +1105,20 @@ <h4 id="_tt_http_serverrequest_tt"><tt>http.ServerRequest</tt></h4>
10991105
<tr>
11001106
<td align="left" valign="top"><p class="table"><tt>"body"</tt></p></td>
11011107
<td align="left" valign="top"><p class="table"><tt>chunk</tt></p></td>
1102-
<td align="left" valign="top"><p class="table">Emitted when a piece of the message body is received. Example: A chunk of
1103-
the body is given as the single argument. The transfer-encoding has been
1104-
decoded. The body chunk is a String. The body encoding is set
1105-
with <tt>request.setBodyEncoding()</tt>.</p></td>
1108+
<td align="left" valign="top"><p class="table">Emitted when a piece of the
1109+
message body is received. Example: A chunk
1110+
of the body is given as the single
1111+
argument. The transfer-encoding has been
1112+
decoded. The body chunk is a String. The
1113+
body encoding is set with
1114+
<tt>request.setBodyEncoding()</tt>.</p></td>
11061115
</tr>
11071116
<tr>
11081117
<td align="left" valign="top"><p class="table"><tt>"complete"</tt></p></td>
1109-
<td align="left" valign="top"><p class="table"></p></td>
1110-
<td align="left" valign="top"><p class="table">Emitted exactly once for each message. No arguments.
1111-
After emitted no other events will be emitted on the request.</p></td>
1118+
<td align="left" valign="top"><p class="table">(none)</p></td>
1119+
<td align="left" valign="top"><p class="table">Emitted exactly once for each message.
1120+
No arguments. After emitted no other
1121+
events will be emitted on the request.</p></td>
11121122
</tr>
11131123
</tbody>
11141124
</table>
@@ -1134,7 +1144,7 @@ <h4 id="_tt_http_serverrequest_tt"><tt>http.ServerRequest</tt></h4>
11341144
<div class="listingblock">
11351145
<div class="content">
11361146
<pre><tt>GET /status?name=ryan HTTP/1.1\r\n
1137-
Accept: */*\r\n
1147+
Accept: text/plain\r\n
11381148
\r\n</tt></pre>
11391149
</div></div>
11401150
<div class="paragraph"><p>Then <tt>request.uri</tt> will be</p></div>
@@ -1149,7 +1159,12 @@ <h4 id="_tt_http_serverrequest_tt"><tt>http.ServerRequest</tt></h4>
11491159
<div class="paragraph"><p>In particular, note that <tt>request.uri.protocol</tt> is
11501160
<tt>undefined</tt>. This is because there was no URI protocol given
11511161
in the actual HTTP Request.</p></div>
1152-
<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>
1162+
<div class="paragraph"><p>Here is what&#8217;s available: <tt>request.uri.anchor</tt>, <tt>request.uri.query</tt>,
1163+
<tt>request.uri.file</tt>, <tt>request.uri.directory</tt>, <tt>request.uri.path</tt>,
1164+
<tt>request.uri.relative</tt>, <tt>request.uri.port</tt>, <tt>request.uri.host</tt>,
1165+
<tt>request.uri.password</tt>, <tt>request.uri.user</tt>, <tt>request.uri.authority</tt>,
1166+
<tt>request.uri.protocol</tt>, <tt>request.uri.params</tt>, <tt>request.uri.toString()</tt>,
1167+
<tt>request.uri.source</tt></p></div>
11531168
</dd>
11541169
<dt class="hdlist1">
11551170
<tt>request.headers</tt>
@@ -2015,7 +2030,7 @@ <h2 id="_extension_api">Extension API</h2>
20152030
<div id="footer">
20162031
<div id="footer-text">
20172032
Version 0.1.12<br />
2018-
Last updated 2009-09-28 21:50:11 CEST
2033+
Last updated 2009-09-29 09:59:52 CEST
20192034
</div>
20202035
</div>
20212036
</body>

doc/api.txt

Lines changed: 52 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ Many objects in Node emit events: a TCP server emits an event each time
136136
there is a connection, a child process emits an event when it exits. All
137137
objects which emit events are are instances of +node.EventEmitter+.
138138

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

142142
Functions can be then be attached to objects, to be executed when an event
143143
is emitted. These functions are called _listeners_.
@@ -368,24 +368,23 @@ Node provides a tridirectional +popen(3)+ facility through the class
368368

369369
[cols="1,2,10",options="header"]
370370
|=========================================================
371-
|Event |Parameters |Notes
372-
373-
|+"output"+ | +data+ |
374-
Each time the child process sends data to its +stdout+, this event is
375-
emitted. +data+ is a string.
376-
+
377-
If the child process closes its +stdout+ stream (a common thing to do on
378-
exit), this event will be emitted with +data === null+.
379-
380-
381-
|+"error"+ | +data+ |
382-
Identical to the +"output"+ event except for +stderr+ instead of +stdout+.
383-
384-
|+"exit"+ | +code+ |
385-
This event is emitted after the child process ends. +code+ is the final exit
386-
code of the process. One can be assured that after this event is emitted
387-
that the +"output"+ and +"error"+ callbacks will no longer be made.
388-
371+
| Event | Parameters |Notes
372+
373+
| +"output"+ | +data+ | Each time the child process
374+
sends data to its +stdout+, this event is
375+
emitted. +data+ is a string. + If the child
376+
process closes its +stdout+ stream (a common
377+
thing to do on exit), this event will be emitted
378+
with +data === null+.
379+
380+
| +"error"+ | +data+ | Identical to the +"output"+ event except for
381+
+stderr+ instead of +stdout+.
382+
383+
| +"exit"+ | +code+ | This event is emitted after the child process
384+
ends. +code+ is the final exit code of the
385+
process. One can be assured that after this
386+
event is emitted that the +"output"+ and
387+
+"error"+ callbacks will no longer be made.
389388
|=========================================================
390389

391390
+node.createChildProcess(command)+::
@@ -594,32 +593,30 @@ HTTP message headers are represented by an object like this
594593
In order to support the full spectrum of possible HTTP applications, Node's
595594
HTTP API is very low-level. It deals with connection handling and message
596595
parsing only. It parses a message into headers and body but it does not
597-
parse the actual headers or the body. That means, for example, that Node
598-
does not, and will never, provide API to access or manipulate Cookies or
599-
multi-part bodies. _This is left to the user._
596+
parse the actual headers or the body.
600597

601598

602599
==== +http.Server+
603600

604601
[cols="1,2,10",options="header"]
605602
|=========================================================
606-
|Event | Parameters | Notes
603+
|Event | Parameters | Notes
607604

608-
|+"request"+ | +request, response+ |
609-
+request+ is an instance of +http.ServerRequest+
610-
+
611-
+response+ is an instance of +http.ServerResponse+
605+
|+"request"+ | +request, response+ | +request+ is an instance of +http.ServerRequest+
606+
+
607+
+response+ is an instance of +http.ServerResponse+
612608

613-
|+"connection"+ | +connection+ |
614-
When a new TCP connection is established.
615-
+connection+ is an object of type +http.Connection+. Usually users will not
616-
want to access this event. The +connection+ can also be accessed at
617-
+request.connection+.
609+
|+"connection"+ | +connection+ | When a new TCP connection is established.
610+
+connection+ is an object of type
611+
+http.Connection+. Usually users
612+
will not want to access this event.
613+
The +connection+ can also be
614+
accessed at +request.connection+.
618615

619-
|+"close"+ | +errorno+ | Emitted when the server closes. +errorno+
620-
is an integer which indicates what, if any,
621-
error caused the server to close. If no
622-
error occured +errorno+ will be 0.
616+
|+"close"+ | +errorno+ | Emitted when the server closes. +errorno+
617+
is an integer which indicates what, if any,
618+
error caused the server to close. If no
619+
error occured +errorno+ will be 0.
623620

624621
|=========================================================
625622

@@ -652,16 +649,17 @@ the user--and passed as the first argument to a +"request"+ listener.
652649
|=========================================================
653650
|Event | Parameters | Notes
654651

655-
|+"body"+ | +chunk+ |
656-
Emitted when a piece of the message body is received. Example: A chunk of
657-
the body is given as the single argument. The transfer-encoding has been
658-
decoded. The body chunk is a String. The body encoding is set
659-
with +request.setBodyEncoding()+.
660-
661-
|+"complete"+ | |
662-
Emitted exactly once for each message. No arguments.
663-
After emitted no other events will be emitted on the request.
664-
652+
|+"body"+ | +chunk+ | Emitted when a piece of the
653+
message body is received. Example: A chunk
654+
of the body is given as the single
655+
argument. The transfer-encoding has been
656+
decoded. The body chunk is a String. The
657+
body encoding is set with
658+
+request.setBodyEncoding()+.
659+
660+
|+"complete"+ | (none) | Emitted exactly once for each message.
661+
No arguments. After emitted no other
662+
events will be emitted on the request.
665663
|=========================================================
666664

667665
+request.method+ ::
@@ -675,7 +673,7 @@ present in the actual HTTP request. That is, if the request is
675673
+
676674
----------------------------------------
677675
GET /status?name=ryan HTTP/1.1\r\n
678-
Accept: */*\r\n
676+
Accept: text/plain\r\n
679677
\r\n
680678
----------------------------------------
681679
+
@@ -693,7 +691,12 @@ In particular, note that +request.uri.protocol+ is
693691
+undefined+. This is because there was no URI protocol given
694692
in the actual HTTP Request.
695693
+
696-
+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+
694+
Here is what's available: +request.uri.anchor+, +request.uri.query+,
695+
+request.uri.file+, +request.uri.directory+, +request.uri.path+,
696+
+request.uri.relative+, +request.uri.port+, +request.uri.host+,
697+
+request.uri.password+, +request.uri.user+, +request.uri.authority+,
698+
+request.uri.protocol+, +request.uri.params+, +request.uri.toString()+,
699+
+request.uri.source+
697700

698701

699702
+request.headers+ ::

0 commit comments

Comments
 (0)