Skip to content

Commit 04b0c49

Browse files
committed
Update documentation
1 parent 869ae79 commit 04b0c49

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+6233
-61
lines changed

.gitignore

-1
This file was deleted.

README.md

-15
This file was deleted.

doc/node-api-assert.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Node.js Documentation
44
https://nodejs.org
55

66
==============================================================================
7-
CONTENTS *node-api-contents*
7+
CONTENTS *node-api-assert-contents*
88

99
1. Intro |node-api-assert|
1010
2. Methods |node-api-assert-methods|

doc/node-api-cluster.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Node.js Documentation
44
https://nodejs.org
55

66
==============================================================================
7-
CONTENTS *node-api-contents*
7+
CONTENTS *node-api-cluster-contents*
88

99
1. Intro |node-api-cluster|
1010
2. Methods |node-api-cluster-methods|

doc/node-api-crypto.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Node.js Documentation
44
https://nodejs.org
55

66
==============================================================================
7-
CONTENTS *node-api-contents*
7+
CONTENTS *node-api-crypto-contents*
88

99
1. Intro |node-api-crypto|
1010
2. Methods |node-api-crypto-methods|

doc/node-api-dgram.txt

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
*node-api-dgram.txt* For Node.js module `UDP / Datagram Sockets` version v3.3.0.
2+
3+
Node.js Documentation
4+
https://nodejs.org
5+
6+
==============================================================================
7+
CONTENTS *node-api-dgram-contents*
8+
9+
1. Intro |node-api-dgram|
10+
2. Methods |node-api-dgram-methods|
11+
2.1. dgram.createSocket(type[, callback]) |node-api-dgram.createSocket()|
12+
2.2. dgram.createSocket(options[, callback]) |node-api-dgram.createSocket()|
13+
3. Properties |node-api-dgram-properties|
14+
15+
==============================================================================
16+
INTRO *node-api-dgram*
17+
18+
Stability: 2 - Stable
19+
20+
Datagram sockets are available through `require('dgram')`.
21+
22+
Important note: the behavior of `dgram.Socket#bind()` has changed in v0.10
23+
and is always asynchronous now. If you have code that looks like this:
24+
25+
>
26+
var s = dgram.createSocket('udp4');
27+
s.bind(1234);
28+
s.addMembership('224.0.0.114');
29+
<
30+
31+
You have to change it to this:
32+
33+
>
34+
var s = dgram.createSocket('udp4');
35+
s.bind(1234, function() {
36+
s.addMembership('224.0.0.114');
37+
});
38+
<
39+
40+
==============================================================================
41+
METHODS *node-api-dgram-methods*
42+
43+
------------------------------------------------------------------------------
44+
dgram.createSocket(type[, callback]) *node-api-dgram.createSocket()*
45+
46+
Creates a datagram Socket of the specified types. Valid types are `udp4`
47+
and `udp6`.
48+
49+
Takes an optional callback which is added as a listener for `message` events.
50+
51+
Call `socket.bind()` if you want to receive datagrams. `socket.bind()` will
52+
bind to the "all interfaces" address on a random port (it does the right thing
53+
for both `udp4` and `udp6` sockets). You can then retrieve the address and port
54+
with `socket.address().address` and `socket.address().port`.
55+
56+
57+
------------------------------------------------------------------------------
58+
dgram.createSocket(options[, callback]) *node-api-dgram.createSocket()*
59+
60+
The `options` object should contain a `type` field of either `udp4` or `udp6`
61+
and an optional boolean `reuseAddr` field.
62+
63+
When `reuseAddr` is `true` `socket.bind()` will reuse the address, even if
64+
another process has already bound a socket on it. `reuseAddr` defaults to
65+
`false`.
66+
67+
Takes an optional callback which is added as a listener for `message` events.
68+
69+
Call `socket.bind()` if you want to receive datagrams. `socket.bind()` will
70+
bind to the "all interfaces" address on a random port (it does the right thing
71+
for both `udp4` and `udp6` sockets). You can then retrieve the address and port
72+
with `socket.address().address` and `socket.address().port`.
73+
74+
75+
76+
==============================================================================
77+
PROPERTIES *node-api-dgram-properties*
78+
79+
vim:tw=78:ts=8:ft=help

doc/node-api-dns.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Node.js Documentation
44
https://nodejs.org
55

66
==============================================================================
7-
CONTENTS *node-api-contents*
7+
CONTENTS *node-api-dns-contents*
88

99
1. Intro |node-api-dns|
1010
2. Methods |node-api-dns-methods|

doc/node-api-domain.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Node.js Documentation
44
https://nodejs.org
55

66
==============================================================================
7-
CONTENTS *node-api-contents*
7+
CONTENTS *node-api-domain-contents*
88

99
1. Intro |node-api-domain|
1010
2. Methods |node-api-domain-methods|

doc/node-api-fs.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Node.js Documentation
44
https://nodejs.org
55

66
==============================================================================
7-
CONTENTS *node-api-contents*
7+
CONTENTS *node-api-fs-contents*
88

99
1. Intro |node-api-fs|
1010
2. Methods |node-api-fs-methods|

doc/node-api-http.txt

+35-35
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Node.js Documentation
44
https://nodejs.org
55

66
==============================================================================
7-
CONTENTS *node-api-contents*
7+
CONTENTS *node-api-http-contents*
88

99
1. Intro |node-api-http|
1010
2. Methods |node-api-http-methods|
@@ -79,14 +79,14 @@ Returns a new instance of *node-api-http_class_http_server*.
7979
The `requestListener` is a function which is automatically
8080
added to the `'request'` event.
8181

82-
82+
8383
------------------------------------------------------------------------------
8484
http.createClient([port][, host]) *node-api-http.createClient()*
8585

8686
Constructs a new HTTP client. `port` and `host` refer to the server to be
8787
connected to.
8888

89-
89+
9090
------------------------------------------------------------------------------
9191
http.request(options[, callback]) *node-api-http.request()*
9292

@@ -99,7 +99,7 @@ automatically parsed with [url.parse()][].
9999
Options:
100100

101101
* `protocol`: Protocol to use. Defaults to `'http'`.
102-
102+
103103
* `host`: A domain name or IP address of the server to issue the request to.
104104
Defaults to `'localhost'`.
105105
* `hostname`: Alias for `host`. To support `url.parse()` `hostname` is
@@ -124,24 +124,24 @@ Options:
124124
* `Agent` object: explicitly use the passed in `Agent`.
125125
* `false`: opts out of connection pooling with an Agent, defaults request to
126126
`Connection: close`.
127-
127+
128128
The optional `callback` parameter will be added as a one time listener for
129129
the ['response'][] event.
130-
131-
130+
131+
132132
`http.request()` returns an instance of the [http.ClientRequest][]
133133
class. The `ClientRequest` instance is a writable stream. If one needs to
134134
upload a file with a POST request, then write to the `ClientRequest` object.
135-
136-
135+
136+
137137
Example:
138-
139-
138+
139+
140140
>
141141
var postData = querystring.stringify({
142142
'msg' : 'Hello World!'
143143
});
144-
144+
145145
var options = {
146146
hostname: 'www.google.com',
147147
port: 80,
@@ -152,7 +152,7 @@ Options:
152152
'Content-Length': postData.length
153153
}
154154
};
155-
155+
156156
var req = http.request(options, function(res) {
157157
console.log('STATUS: ' + res.statusCode);
158158
console.log('HEADERS: ' + JSON.stringify(res.headers));
@@ -164,45 +164,45 @@ Options:
164164
console.log('No more data in response.')
165165
})
166166
});
167-
167+
168168
req.on('error', function(e) {
169169
console.log('problem with request: ' + e.message);
170170
});
171-
171+
172172
// write data to request body
173173
req.write(postData);
174174
req.end();
175-
<
176-
175+
<
176+
177177
Note that in the example `req.end()` was called. With `http.request()` one
178178
must always call `req.end()` to signify that you're done with the request -
179179
even if there is no data being written to the request body.
180-
181-
180+
181+
182182
If any error is encountered during the request (be that with DNS resolution,
183183
TCP level errors, or actual HTTP parse errors) an `'error'` event is emitted
184184
on the returned request object.
185-
186-
185+
186+
187187
There are a few special headers that should be noted.
188-
189-
190-
188+
189+
190+
191191
* Sending a 'Connection: keep-alive' will notify io.js that the connection to
192192
the server should be persisted until the next request.
193-
193+
194194
* Sending a 'Content-length' header will disable the default chunked encoding.
195-
195+
196196
* Sending an 'Expect' header will immediately send the request headers.
197197
Usually, when sending 'Expect: 100-continue', you should both set a timeout
198198
and listen for the `continue` event. See RFC2616 Section 8.2.3 for more
199199
information.
200-
200+
201201
* Sending an Authorization header will override using the `auth` option
202202
to compute basic authentication.
203+
203204

204-
205-
205+
206206
------------------------------------------------------------------------------
207207
http.get(options[, callback]) *node-api-http.get()*
208208

@@ -220,7 +220,7 @@ Example:
220220
});
221221
<
222222

223-
223+
224224

225225
==============================================================================
226226
PROPERTIES *node-api-http-properties*
@@ -230,22 +230,22 @@ PROPERTIES *node-api-http-properties*
230230

231231
A list of the HTTP methods that are supported by the parser.
232232

233-
233+
234234
------------------------------------------------------------------------------
235235
`STATUS_CODES` {Object} *node-api-http.STATUS_CODES*
236236

237237
A collection of all the standard HTTP response status codes, and the
238238
short description of each. For example, `http.STATUS_CODES[404] === 'Not
239239
Found'`.
240240

241-
241+
242242
------------------------------------------------------------------------------
243243
http.globalAgent *node-api-http.globalAgent*
244244

245245
Global instance of Agent which is used as the default for all http client
246246
requests.
247247

248-
248+
249249
------------------------------------------------------------------------------
250250
http.IncomingMessage *node-api-http.IncomingMessage*
251251

@@ -257,6 +257,6 @@ headers and data.
257257
It implements the [Readable Stream][] interface, as well as the
258258
following additional events, methods, and properties.
259259

260+
260261

261-
262-
vim:tw=78:ts=8:ft=help
262+
vim:tw=78:ts=8:ft=help

doc/node-api-https.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Node.js Documentation
44
https://nodejs.org
55

66
==============================================================================
7-
CONTENTS *node-api-contents*
7+
CONTENTS *node-api-https-contents*
88

99
1. Intro |node-api-https|
1010
2. Methods |node-api-https-methods|

doc/node-api-net.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Node.js Documentation
44
https://nodejs.org
55

66
==============================================================================
7-
CONTENTS *node-api-contents*
7+
CONTENTS *node-api-net-contents*
88

99
1. Intro |node-api-net|
1010
2. Methods |node-api-net-methods|

doc/node-api-os.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Node.js Documentation
44
https://nodejs.org
55

66
==============================================================================
7-
CONTENTS *node-api-contents*
7+
CONTENTS *node-api-os-contents*
88

99
1. Intro |node-api-os|
1010
2. Methods |node-api-os-methods|

doc/node-api-path.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Node.js Documentation
44
https://nodejs.org
55

66
==============================================================================
7-
CONTENTS *node-api-contents*
7+
CONTENTS *node-api-path-contents*
88

99
1. Intro |node-api-path|
1010
2. Methods |node-api-path-methods|

0 commit comments

Comments
 (0)