Skip to content

Commit 71f22c8

Browse files
committed
doc: replace uses of you and other style nits
Replace uses of the pronouns `you` and `your` throughout the docs + other minor style nits PR-URL: #12673 Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
1 parent f11d4a1 commit 71f22c8

13 files changed

+129
-125
lines changed

doc/api/addons.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ involving knowledge of several components and APIs :
3737
See [Linking to Node.js' own dependencies][] for additional information.
3838

3939
All of the following examples are available for [download][] and may
40-
be used as a starting-point for your own Addon.
40+
be used as the starting-point for an Addon.
4141

4242
## Hello world
4343

@@ -98,7 +98,7 @@ Addon module name is `addon`.
9898

9999
Once the source code has been written, it must be compiled into the binary
100100
`addon.node` file. To do so, create a file called `binding.gyp` in the
101-
top-level of the project describing the build configuration of your module
101+
top-level of the project describing the build configuration of the module
102102
using a JSON-like format. This file is used by [node-gyp][] -- a tool written
103103
specifically to compile Node.js Addons.
104104

doc/api/child_process.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -808,8 +808,8 @@ The `'error'` event is emitted whenever:
808808
2. The process could not be killed, or
809809
3. Sending a message to the child process failed.
810810

811-
Note that the `'exit'` event may or may not fire after an error has occurred.
812-
If you are listening to both the `'exit'` and `'error'` events, it is important
811+
*Note*: The `'exit'` event may or may not fire after an error has occurred.
812+
When listening to both the `'exit'` and `'error'` events, it is important
813813
to guard against accidentally invoking handler functions multiple times.
814814

815815
See also [`child.kill()`][] and [`child.send()`][].

doc/api/cli.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Node.js comes with a variety of CLI options. These options expose built-in
66
debugging, multiple ways to execute scripts, and other helpful runtime options.
77

8-
To view this documentation as a manual page in your terminal, run `man node`.
8+
To view this documentation as a manual page in a terminal, run `man node`.
99

1010

1111
## Synopsis

doc/api/cluster.md

+38-39
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ A single instance of Node.js runs in a single thread. To take advantage of
66
multi-core systems the user will sometimes want to launch a cluster of Node.js
77
processes to handle the load.
88

9-
The cluster module allows you to easily create child processes that
10-
all share server ports.
9+
The cluster module allows easy creation of child processes that all share
10+
server ports.
1111

1212
```js
1313
const cluster = require('cluster');
@@ -88,27 +88,24 @@ Node.js process and a cluster worker differs:
8888
idea of what the number 7 file descriptor references.
8989
2. `server.listen(handle)` Listening on handles explicitly will cause
9090
the worker to use the supplied handle, rather than talk to the master
91-
process. If the worker already has the handle, then it's presumed
92-
that you know what you are doing.
91+
process.
9392
3. `server.listen(0)` Normally, this will cause servers to listen on a
9493
random port. However, in a cluster, each worker will receive the
9594
same "random" port each time they do `listen(0)`. In essence, the
96-
port is random the first time, but predictable thereafter. If you
97-
want to listen on a unique port, generate a port number based on the
98-
cluster worker ID.
95+
port is random the first time, but predictable thereafter. To listen
96+
on a unique port, generate a port number based on the cluster worker ID.
9997

100-
There is no routing logic in Node.js, or in your program, and no shared
101-
state between the workers. Therefore, it is important to design your
102-
program such that it does not rely too heavily on in-memory data objects
103-
for things like sessions and login.
98+
*Note*: Node.js does not provide routing logic. It is, therefore important to
99+
design an application such that it does not rely too heavily on in-memory data
100+
objects for things like sessions and login.
104101

105102
Because workers are all separate processes, they can be killed or
106-
re-spawned depending on your program's needs, without affecting other
103+
re-spawned depending on a program's needs, without affecting other
107104
workers. As long as there are some workers still alive, the server will
108105
continue to accept connections. If no workers are alive, existing connections
109-
will be dropped and new connections will be refused. Node.js does not
110-
automatically manage the number of workers for you, however. It is your
111-
responsibility to manage the worker pool for your application's needs.
106+
will be dropped and new connections will be refused. Node.js does not
107+
automatically manage the number of workers, however. It is the application's
108+
responsibility to manage the worker pool based on its own needs.
112109

113110

114111

@@ -141,7 +138,7 @@ added: v0.7.3
141138

142139
This event is the same as the one provided by [`child_process.fork()`][].
143140

144-
In a worker you can also use `process.on('error')`.
141+
Within a worker, `process.on('error')` may also be used.
145142

146143
### Event: 'exit'
147144
<!-- YAML
@@ -192,8 +189,9 @@ added: v0.7.0
192189
* `message` {Object}
193190
* `handle` {undefined|Object}
194191

195-
Similar to the `cluster.on('message')` event, but specific to this worker. In a
196-
worker you can also use `process.on('message')`.
192+
Similar to the `cluster.on('message')` event, but specific to this worker.
193+
194+
Within a worker, `process.on('message)` may also be used.
197195

198196
See [`process` event: `'message'`][].
199197

@@ -336,9 +334,9 @@ added: v6.0.0
336334

337335
Set by calling `.kill()` or `.disconnect()`. Until then, it is `undefined`.
338336

339-
The boolean `worker.exitedAfterDisconnect` lets you distinguish between voluntary
340-
and accidental exit, the master may choose not to respawn a worker based on
341-
this value.
337+
The boolean `worker.exitedAfterDisconnect` allows distinguishing between
338+
voluntary and accidental exit, the master may choose not to respawn a worker
339+
based on this value.
342340

343341
```js
344342
cluster.on('exit', (worker, code, signal) => {
@@ -369,9 +367,9 @@ cluster.workers
369367
added: v0.11.14
370368
-->
371369

372-
This function returns `true` if the worker is connected to its master via its IPC
373-
channel, `false` otherwise. A worker is connected to its master after it's been
374-
created. It is disconnected after the `'disconnect'` event is emitted.
370+
This function returns `true` if the worker is connected to its master via its
371+
IPC channel, `false` otherwise. A worker is connected to its master after it
372+
has been created. It is disconnected after the `'disconnect'` event is emitted.
375373

376374
### worker.isDead()
377375
<!-- YAML
@@ -469,7 +467,7 @@ An alias to [`worker.exitedAfterDisconnect`][].
469467

470468
Set by calling `.kill()` or `.disconnect()`. Until then, it is `undefined`.
471469

472-
The boolean `worker.suicide` lets you distinguish between voluntary
470+
The boolean `worker.suicide` is used to distinguish between voluntary
473471
and accidental exit, the master may choose not to respawn a worker based on
474472
this value.
475473

@@ -540,7 +538,7 @@ added: v0.7.0
540538
* `worker` {cluster.Worker}
541539

542540
When a new worker is forked the cluster module will emit a `'fork'` event.
543-
This can be used to log worker activity, and create your own timeout.
541+
This can be used to log worker activity, and create a custom timeout.
544542

545543
```js
546544
const timeouts = [];
@@ -568,13 +566,14 @@ added: v0.7.0
568566
* `worker` {cluster.Worker}
569567
* `address` {Object}
570568

571-
After calling `listen()` from a worker, when the `'listening'` event is emitted on
572-
the server, a `'listening'` event will also be emitted on `cluster` in the master.
569+
After calling `listen()` from a worker, when the `'listening'` event is emitted
570+
on the server a `'listening'` event will also be emitted on `cluster` in the
571+
master.
573572

574-
The event handler is executed with two arguments, the `worker` contains the worker
575-
object and the `address` object contains the following connection properties:
576-
`address`, `port` and `addressType`. This is very useful if the worker is listening
577-
on more than one address.
573+
The event handler is executed with two arguments, the `worker` contains the
574+
worker object and the `address` object contains the following connection
575+
properties: `address`, `port` and `addressType`. This is very useful if the
576+
worker is listening on more than one address.
578577

579578
```js
580579
cluster.on('listening', (worker, address) => {
@@ -610,8 +609,9 @@ See [child_process event: 'message'][].
610609
Before Node.js v6.0, this event emitted only the message and the handle,
611610
but not the worker object, contrary to what the documentation stated.
612611

613-
If you need to support older versions and don't need the worker object,
614-
you can work around the discrepancy by checking the number of arguments:
612+
If support for older versions is required but a worker object is not
613+
required, it is possible to work around the discrepancy by checking the
614+
number of arguments:
615615

616616
```js
617617
cluster.on('message', (worker, message, handle) => {
@@ -713,8 +713,8 @@ added: v0.11.2
713713

714714
The scheduling policy, either `cluster.SCHED_RR` for round-robin or
715715
`cluster.SCHED_NONE` to leave it to the operating system. This is a
716-
global setting and effectively frozen once you spawn the first worker
717-
or call `cluster.setupMaster()`, whatever comes first.
716+
global setting and effectively frozen once either the first worker is spawned,
717+
or `cluster.setupMaster()` is called, whichever comes first.
718718

719719
`SCHED_RR` is the default on all operating systems except Windows.
720720
Windows will change to `SCHED_RR` once libuv is able to effectively
@@ -750,7 +750,7 @@ changes:
750750
After calling `.setupMaster()` (or `.fork()`) this settings object will contain
751751
the settings, including the default values.
752752

753-
This object is not supposed to be changed or set manually, by you.
753+
This object is not intended to be changed or set manually.
754754

755755
## cluster.setupMaster([settings])
756756
<!-- YAML
@@ -850,8 +850,7 @@ eachWorker((worker) => {
850850
});
851851
```
852852

853-
Should you wish to reference a worker over a communication channel, using
854-
the worker's unique id is the easiest way to find the worker.
853+
Using the worker's unique id is the easiest way to locate the worker.
855854

856855
```js
857856
socket.on('data', (id) => {

doc/api/console.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ added: v0.1.104
257257
* `label` {string}
258258

259259
Starts a timer that can be used to compute the duration of an operation. Timers
260-
are identified by a unique `label`. Use the same `label` when you call
260+
are identified by a unique `label`. Use the same `label` when calling
261261
[`console.timeEnd()`][] to stop the timer and output the elapsed time in
262262
milliseconds to `stdout`. Timer durations are accurate to the sub-millisecond.
263263

doc/api/dgram.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -301,9 +301,8 @@ The only way to know for sure that the datagram has been sent is by using a
301301
passed as the first argument to the `callback`. If a `callback` is not given,
302302
the error is emitted as an `'error'` event on the `socket` object.
303303

304-
Offset and length are optional, but if you specify one you would need to
305-
specify the other. Also, they are supported only when the first
306-
argument is a `Buffer` or `Uint8Array`.
304+
Offset and length are optional but both *must* be set if either are used.
305+
They are supported only when the first argument is a `Buffer` or `Uint8Array`.
307306

308307
Example of sending a UDP packet to a random port on `localhost`;
309308

@@ -329,8 +328,10 @@ client.send([buf1, buf2], 41234, (err) => {
329328
});
330329
```
331330

332-
Sending multiple buffers might be faster or slower depending on your
333-
application and operating system: benchmark it. Usually it is faster.
331+
Sending multiple buffers might be faster or slower depending on the
332+
application and operating system. It is important to run benchmarks to
333+
determine the optimal strategy on a case-by-case basis. Generally speaking,
334+
however, sending multiple buffers is faster.
334335

335336
**A Note about UDP datagram size**
336337

doc/api/documentation.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@ documentation is generated using the `tools/doc/generate.js` program.
2121
The HTML template is located at `doc/template.html`.
2222

2323

24-
If you find an error in this documentation, please [submit an issue][]
24+
If errors are found in this documentation, please [submit an issue][]
2525
or see [the contributing guide][] for directions on how to submit a patch.
2626

2727
## Stability Index
2828

2929
<!--type=misc-->
3030

31-
Throughout the documentation, you will see indications of a section's
32-
stability. The Node.js API is still somewhat changing, and as it
33-
matures, certain parts are more reliable than others. Some are so
31+
Throughout the documentation are indications of a section's
32+
stability. The Node.js API is still somewhat changing, and as it
33+
matures, certain parts are more reliable than others. Some are so
3434
proven, and so relied upon, that they are unlikely to ever change at
35-
all. Others are brand new and experimental, or known to be hazardous
35+
all. Others are brand new and experimental, or known to be hazardous
3636
and in the process of being redesigned.
3737

3838
The stability indices are as follows:

doc/api/domain.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@ exit immediately with an error code.
2727

2828
<!-- type=misc -->
2929

30-
Domain error handlers are not a substitute for closing down your
30+
Domain error handlers are not a substitute for closing down a
3131
process when an error occurs.
3232

3333
By the very nature of how [`throw`][] works in JavaScript, there is almost
3434
never any way to safely "pick up where you left off", without leaking
3535
references, or creating some other sort of undefined brittle state.
3636

3737
The safest way to respond to a thrown error is to shut down the
38-
process. Of course, in a normal web server, you might have many
39-
connections open, and it is not reasonable to abruptly shut those down
38+
process. Of course, in a normal web server, there may be many
39+
open connections, and it is not reasonable to abruptly shut those down
4040
because an error was triggered by someone else.
4141

4242
The better approach is to send an error response to the request that
@@ -80,11 +80,11 @@ const cluster = require('cluster');
8080
const PORT = +process.env.PORT || 1337;
8181

8282
if (cluster.isMaster) {
83-
// In real life, you'd probably use more than just 2 workers,
83+
// A more realistic scenario would have more than 2 workers,
8484
// and perhaps not put the master and worker in the same file.
8585
//
86-
// You can also of course get a bit fancier about logging, and
87-
// implement whatever custom logic you need to prevent DoS
86+
// It is also possible to get a bit fancier about logging, and
87+
// implement whatever custom logic is needed to prevent DoS
8888
// attacks and other bad behavior.
8989
//
9090
// See the options in the cluster documentation.
@@ -161,7 +161,7 @@ if (cluster.isMaster) {
161161
}
162162

163163
// This part is not important. Just an example routing thing.
164-
// You'd put your fancy application logic here.
164+
// Put fancy application logic here.
165165
function handleRequest(req, res) {
166166
switch (req.url) {
167167
case '/error':
@@ -202,16 +202,16 @@ the active domain at the time of their creation.
202202

203203
Additionally, callbacks passed to lowlevel event loop requests (such as
204204
to fs.open, or other callback-taking methods) will automatically be
205-
bound to the active domain. If they throw, then the domain will catch
205+
bound to the active domain. If they throw, then the domain will catch
206206
the error.
207207

208208
In order to prevent excessive memory usage, Domain objects themselves
209209
are not implicitly added as children of the active domain. If they
210210
were, then it would be too easy to prevent request and response objects
211211
from being properly garbage collected.
212212

213-
If you *want* to nest Domain objects as children of a parent Domain,
214-
then you must explicitly add them.
213+
To nest Domain objects as children of a parent Domain they must be explicitly
214+
added.
215215

216216
Implicit binding routes thrown errors and `'error'` events to the
217217
Domain's `'error'` event, but does not register the EventEmitter on the

0 commit comments

Comments
 (0)