Skip to content

Commit 11b2ee7

Browse files
silasry
authored andcommitted
Various doc tweaks (2-spaces vs tabs, EOL-whitespace, repl prompt, "world" vs "World", etc...)
1 parent c11f3f8 commit 11b2ee7

15 files changed

+98
-98
lines changed

doc/api/addons.markdown

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ To get started we create a file `hello.cc`:
4040
using namespace v8;
4141

4242
extern "C" void
43-
init (Handle<Object> target)
43+
init (Handle<Object> target)
4444
{
4545
HandleScope scope;
46-
target->Set(String::New("hello"), String::New("World"));
46+
target->Set(String::New("hello"), String::New("world"));
4747
}
4848

4949
This source code needs to be built into `hello.node`, the binary Addon. To

doc/api/assert.markdown

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Tests if value is a `true` value, it is equivalent to `assert.equal(true, value,
1313

1414
### assert.equal(actual, expected, [message])
1515

16-
Tests shallow, coercive equality with the equal comparison operator ( `==` ).
16+
Tests shallow, coercive equality with the equal comparison operator ( `==` ).
1717

1818
### assert.notEqual(actual, expected, [message])
1919

@@ -25,15 +25,15 @@ Tests for deep equality.
2525

2626
### assert.notDeepEqual(actual, expected, [message])
2727

28-
Tests for any deep inequality.
28+
Tests for any deep inequality.
2929

3030
### assert.strictEqual(actual, expected, [message])
3131

32-
Tests strict equality, as determined by the strict equality operator ( `===` )
32+
Tests strict equality, as determined by the strict equality operator ( `===` )
3333

3434
### assert.notStrictEqual(actual, expected, [message])
3535

36-
Tests strict non-equality, as determined by the strict not equal operator ( `!==` )
36+
Tests strict non-equality, as determined by the strict not equal operator ( `!==` )
3737

3838
### assert.throws(block, [error], [message])
3939

doc/api/buffers.markdown

+5-5
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Example: write a utf8 string into a buffer, then print it
5353
console.log(len + " bytes: " + buf.toString('utf8', 0, len));
5454

5555
// 12 bytes: ½ + ¼ = ¾
56-
56+
5757

5858
### buffer.toString(encoding, start=0, end=buffer.length)
5959

@@ -84,7 +84,7 @@ Example: copy an ASCII string into a buffer, one byte at a time:
8484

8585
### Buffer.byteLength(string, encoding='utf8')
8686

87-
Gives the actual byte length of a string. This is not the same as
87+
Gives the actual byte length of a string. This is not the same as
8888
`String.prototype.length` since that returns the number of *characters* in a
8989
string.
9090

@@ -101,7 +101,7 @@ Example:
101101
### buffer.length
102102

103103
The size of the buffer in bytes. Note that this is not necessarily the size
104-
of the contents. `length` refers to the amount of memory allocated for the
104+
of the contents. `length` refers to the amount of memory allocated for the
105105
buffer object. It does not change when the contents of the buffer are changed.
106106

107107
buf = new Buffer(1234);
@@ -122,7 +122,7 @@ into `buf2`, starting at the 8th byte in `buf2`.
122122

123123
buf1 = new Buffer(26);
124124
buf2 = new Buffer(26);
125-
125+
126126
for (var i = 0 ; i < 26 ; i++) {
127127
buf1[i] = i + 97; // 97 is ASCII a
128128
buf2[i] = 33; // ASCII !
@@ -132,7 +132,7 @@ into `buf2`, starting at the 8th byte in `buf2`.
132132
console.log(buf2.toString('ascii', 0, 25));
133133

134134
// !!!!!!!!qrst!!!!!!!!!!!!!
135-
135+
136136

137137
### buffer.slice(start, end=buffer.length)
138138

doc/api/child_processes.markdown

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ output, and return it all in a callback.
145145
exec = require('child_process').exec,
146146
child;
147147

148-
child = exec('cat *.js bad_file | wc -l',
148+
child = exec('cat *.js bad_file | wc -l',
149149
function (error, stdout, stderr) {
150150
console.log('stdout: ' + stdout);
151151
console.log('stderr: ' + stderr);

doc/api/dgram.markdown

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## dgram
22

3-
Datagram sockets are available through `require('dgram')`. Datagrams are most commonly
3+
Datagram sockets are available through `require('dgram')`. Datagrams are most commonly
44
handled as IP/UDP messages, but they can also be used over Unix domain sockets.
55

66
### Event: 'message'
@@ -27,15 +27,15 @@ on this socket.
2727
### dgram.createSocket(type, [callback])
2828

2929
Creates a datagram socket of the specified types. Valid types are:
30-
`udp4`, `udp6`, and `unix_dgram`.
30+
`udp4`, `udp6`, and `unix_dgram`.
3131

3232
Takes an optional callback which is added as a listener for `message` events.
3333

3434
### dgram.send(buf, offset, length, path, [callback])
3535

3636
For Unix domain datagram sockets, the destination address is a pathname in the filesystem.
3737
An optional callback may be supplied that is invoked after the `sendto` call is completed
38-
by the OS. It is not safe to re-use `buf` until the callback is invoked. Note that
38+
by the OS. It is not safe to re-use `buf` until the callback is invoked. Note that
3939
unless the socket is bound to a pathname with `bind()` there is no way to receive messages
4040
on this socket.
4141

@@ -55,7 +55,7 @@ Example of sending a message to syslogd on OSX via Unix domain socket `/var/run/
5555
### dgram.send(buf, offset, length, port, address, [callback])
5656

5757
For UDP sockets, the destination port and IP address must be specified. A string
58-
may be supplied for the `address` parameter, and it will be resolved with DNS. An
58+
may be supplied for the `address` parameter, and it will be resolved with DNS. An
5959
optional callback may be specified to detect any DNS errors and when `buf` may be
6060
re-used. Note that DNS lookups will delay the time that a send takes place, at
6161
least until the next tick. The only way to know for sure that a send has taken place
@@ -143,12 +143,12 @@ Example of a UDP server listening on port 41234:
143143

144144
### dgram.close()
145145

146-
Close the underlying socket and stop listening for data on it. UDP sockets
146+
Close the underlying socket and stop listening for data on it. UDP sockets
147147
automatically listen for messages, even if they did not call `bind()`.
148148

149149
### dgram.address()
150150

151-
Returns an object containing the address information for a socket. For UDP sockets,
151+
Returns an object containing the address information for a socket. For UDP sockets,
152152
this object will contain `address` and `port`. For Unix domain sockets, it will contain
153153
only `address`.
154154

@@ -160,9 +160,9 @@ may be sent to a local interface's broadcast address.
160160
### dgram.setTTL(ttl)
161161

162162
Sets the `IP_TTL` socket option. TTL stands for "Time to Live," but in this context it
163-
specifies the number of IP hops that a packet is allowed to go through. Each router or
163+
specifies the number of IP hops that a packet is allowed to go through. Each router or
164164
gateway that forwards a packet decrements the TTL. If the TTL is decremented to 0 by a
165-
router, it will not be forwarded. Changing TTL values is typically done for network
165+
router, it will not be forwarded. Changing TTL values is typically done for network
166166
probes or when multicasting.
167167

168168
The argument to `setTTL()` is a number of hops between 1 and 255. The default on most

doc/api/dns.markdown

+4-4
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ the error in English.
5454

5555
### dns.resolve4(domain, callback)
5656

57-
The same as `dns.resolve()`, but only for IPv4 queries (`A` records).
58-
`addresses` is an array of IPv4 addresses (e.g.
57+
The same as `dns.resolve()`, but only for IPv4 queries (`A` records).
58+
`addresses` is an array of IPv4 addresses (e.g.
5959
`['74.125.79.104', '74.125.79.105', '74.125.79.106']`).
6060

6161
### dns.resolve6(domain, callback)
@@ -80,14 +80,14 @@ The same as `dns.resolve()`, but only for text queries (`TXT` records).
8080

8181
The same as `dns.resolve()`, but only for service records (`SRV` records).
8282
`addresses` is an array of the SRV records available for `domain`. Properties
83-
of SRV records are priority, weight, port, and name (e.g.,
83+
of SRV records are priority, weight, port, and name (e.g.,
8484
`[{'priority': 10, {'weight': 5, 'port': 21223, 'name': 'service.example.com'}, ...]`).
8585

8686
### dns.reverse(ip, callback)
8787

8888
Reverse resolves an ip address to an array of domain names.
8989

90-
The callback has arguments `(err, domains)`.
90+
The callback has arguments `(err, domains)`.
9191

9292
If there an an error, `err` will be non-null and an instanceof the Error
9393
object.

doc/api/events.markdown

+20-20
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
## Events
22

33
Many objects in Node emit events: a `net.Server` emits an event each time
4-
a peer connects to it, a `fs.readStream` emits an event when the file is
4+
a peer connects to it, a `fs.readStream` emits an event when the file is
55
opened. All objects which emit events are instances of `events.EventEmitter`.
66
You can access this module by doing: `require("events");`
77

8-
Typically, event names are represented by a camel-cased string, however,
8+
Typically, event names are represented by a camel-cased string, however,
99
there aren't any strict restrictions on that, as any string will be accepted.
1010

1111
Functions can be then be attached to objects, to be executed when an event
@@ -16,9 +16,9 @@ is emitted. These functions are called _listeners_.
1616

1717
To access the EventEmitter class, `require('events').EventEmitter`.
1818

19-
When an `EventEmitter` instance experiences an error, the typical action is
19+
When an `EventEmitter` instance experiences an error, the typical action is
2020
to emit an `'error'` event. Error events are treated as a special case in node.
21-
If there is no listener for it, then the default action is to print a stack
21+
If there is no listener for it, then the default action is to print a stack
2222
trace and exit the program.
2323

2424
All EventEmitters emit the event `'newListener'` when new listeners are
@@ -29,31 +29,31 @@ added.
2929

3030
Adds a listener to the end of the listeners array for the specified event.
3131

32-
server.on('connection', function (stream) {
33-
console.log('someone connected!');
34-
});
32+
server.on('connection', function (stream) {
33+
console.log('someone connected!');
34+
});
3535

3636
#### emitter.once(event, listener)
3737

3838
Adds a **one time** listener for the event. The listener is
3939
invoked only the first time the event is fired, after which
4040
it is removed.
4141

42-
server.once('connection', function (stream) {
43-
console.log('Ah, we have our first user!');
44-
});
42+
server.once('connection', function (stream) {
43+
console.log('Ah, we have our first user!');
44+
});
4545

4646
#### emitter.removeListener(event, listener)
4747

4848
Remove a listener from the listener array for the specified event.
4949
**Caution**: changes array indices in the listener array behind the listener.
5050

51-
var callback = function(stream) {
52-
console.log('someone connected!');
53-
};
54-
server.on('connection', callback);
55-
// ...
56-
server.removeListener('connection', callback);
51+
var callback = function(stream) {
52+
console.log('someone connected!');
53+
};
54+
server.on('connection', callback);
55+
// ...
56+
server.removeListener('connection', callback);
5757

5858

5959
#### emitter.removeAllListeners(event)
@@ -66,10 +66,10 @@ Removes all listeners from the listener array for the specified event.
6666
Returns an array of listeners for the specified event. This array can be
6767
manipulated, e.g. to remove listeners.
6868

69-
server.on('connection', function (stream) {
70-
console.log('someone connected!');
71-
});
72-
console.log(util.inspect(server.listeners('connection')); // [ [Function] ]
69+
server.on('connection', function (stream) {
70+
console.log('someone connected!');
71+
});
72+
console.log(util.inspect(server.listeners('connection')); // [ [Function] ]
7373

7474
#### emitter.emit(event, [arg1], [arg2], [...])
7575

0 commit comments

Comments
 (0)