Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: change e.g to for example #18397

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ note1 - The gcc4.8-libs package needs to be installed, because node

*Note*: On Windows, running Node.js in windows terminal emulators like `mintty`
requires the usage of [winpty](https://github.com/rprichard/winpty) for
Node's tty channels to work correctly (e.g. `winpty node.exe script.js`).
Node's tty channels to work correctly (for example: `winpty node.exe script.js`).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: while in here, maybe Node's -> Node.js's or even just remove Node's altogether.

In "Git bash" if you call the node shell alias (`node` without the `.exe`
extension), `winpty` is used automatically.

Expand Down Expand Up @@ -251,7 +251,7 @@ To test if Node.js was built correctly:
> Release\node -e "console.log('Hello from Node.js', process.version)"
```

### Android/Android-based devices (e.g. Firefox OS)
### Android/Android-based devices (for example: Firefox OS)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would probably be better/clearer as (Firefox OS, etc.) rather than (for example: Firefox OS).


Although these instructions for building on Android are provided, please note
that Android is not an officially supported platform at this time. Patches to
Expand Down
8 changes: 4 additions & 4 deletions COLLABORATOR_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ Examples of breaking changes include:
* altering expected timing of an event
* changing the side effects of using a particular API

Purely additive changes (e.g. adding new events to `EventEmitter`
Purely additive changes (for example: adding new events to `EventEmitter`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a place where such as is likely called for rather than for example.

implementations, adding new arguments to a method in a way that allows
existing code to continue working without modification, or adding new
properties to an options argument) are semver-minor changes.
Expand All @@ -267,7 +267,7 @@ Such changes *must* be handled as semver-major changes but MAY be landed
without a [Deprecation cycle](#deprecation-cycle).

Note that errors thrown, along with behaviors and APIs implemented by
dependencies of Node.js (e.g. those originating from V8) are generally not
dependencies of Node.js (for example: those originating from V8) are generally not
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

such as

under the control of Node.js and therefore *are not directly subject to this
policy*. However, care should still be taken when landing updates to
dependencies when it is known or expected that breaking changes to error
Expand Down Expand Up @@ -308,7 +308,7 @@ Specifically:

* Breaking changes should *never* land in Current or LTS except when:
* Resolving critical security issues.
* Fixing a critical bug (e.g. fixing a memory leak) requires a breaking
* Fixing a critical bug (for example: fixing a memory leak) requires a breaking
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comma instead of colon

change.
* There is TSC consensus that the change is required.
* If a breaking commit does accidentally land in a Current or LTS branch, an
Expand Down Expand Up @@ -623,7 +623,7 @@ error: failed to push some refs to 'https://github.com/nodejs/node'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g. 'git pull ...') before pushing again.
hint: (for example: 'git pull ...') before pushing again.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is output from a command. It should not be changed.

hint: See the 'Note about fast-forwards' in 'git push --help' for details.
```

Expand Down
2 changes: 1 addition & 1 deletion CPP_STYLE_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ What it says in the title.

## Ownership and Smart Pointers

"Smart" pointers are classes that act like pointers, e.g.
"Smart" pointers are classes that act like pointers, for example:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The : is fine for the parenthetical stuff but it's a problem in ordinary prose like this. I don't think we want to do a global find/replace on this. We want to evaluate each item independently. For example, this instance should probably be changed to such as rather than for example:.

Nit: Get rid of the scare quotes in this sentence and instead italicize the term being defined:

"Smart" pointers -> _Smart pointers_

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Trott Done. Please review.

by overloading the `*` and `->` operators. Some smart pointer types can be
used to automate ownership bookkeeping, to ensure these responsibilities are
met. `std::unique_ptr` is a smart pointer type introduced in C++11, which
Expand Down
2 changes: 1 addition & 1 deletion doc/STYLE_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Documentation is written in markdown files with names formatted as
`lowercase-with-dashes.md`.
* Underscores in filenames are allowed only when they are present in the
topic the document will describe (e.g. `child_process`).
topic the document will describe (for example: `child_process`).
* Some files, such as top-level markdown files, are exceptions.
* Documents should be word-wrapped at 80 characters.
* The formatting described in `.editorconfig` is preferred.
Expand Down
4 changes: 2 additions & 2 deletions doc/api/addons.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ try {
Node.js uses a number of statically linked libraries such as V8, libuv and
OpenSSL. All Addons are required to link to V8 and may link to any of the
other dependencies as well. Typically, this is as simple as including
the appropriate `#include <...>` statements (e.g. `#include <v8.h>`) and
the appropriate `#include <...>` statements (for example: `#include <v8.h>`) and
`node-gyp` will locate the appropriate headers automatically. However, there
are a few caveats to be aware of:

Expand Down Expand Up @@ -221,7 +221,7 @@ illustration of how it can be used.
> Stability: 1 - Experimental

N-API is an API for building native Addons. It is independent from
the underlying JavaScript runtime (e.g. V8) and is maintained as part of
the underlying JavaScript runtime (for example: V8) and is maintained as part of
Node.js itself. This API will be Application Binary Interface (ABI) stable
across version of Node.js. It is intended to insulate Addons from
changes in the underlying JavaScript engine and allow modules
Expand Down
4 changes: 2 additions & 2 deletions doc/api/assert.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Please note that this will also deactivate the colors in the REPL.

When accessing `assert` directly instead of using the `strict` property, the
[Abstract Equality Comparison][] will be used for any function without a
"strict" in its name (e.g. [`assert.deepEqual()`][]).
"strict" in its name (for example: [`assert.deepEqual()`][]).

It can be accessed using:

Expand Down Expand Up @@ -727,7 +727,7 @@ assert.ok(typeof 123 === 'string');
// throws:
// "AssertionError: false == true

// In a file (e.g. test.js):
// In a file (for example: test.js):
assert.ok(typeof 123 === 'string');
// throws:
// "AssertionError: The expression evaluated to a falsy value:
Expand Down
4 changes: 2 additions & 2 deletions doc/api/async_hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ asyncHook.disable();
function init(asyncId, type, triggerAsyncId, resource) { }

// before is called just before the resource's callback is called. It can be
// called 0-N times for handles (e.g. TCPWrap), and will be called exactly 1
// time for requests (e.g. FSReqWrap).
// called 0-N times for handles (for example: TCPWrap), and will be called exactly 1
// time for requests (for example: FSReqWrap).
function before(asyncId) { }

// after is called just after the resource's callback has finished.
Expand Down
4 changes: 2 additions & 2 deletions doc/api/buffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ In versions of Node.js prior to v6, `Buffer` instances were created using the
`Buffer` constructor function, which allocates the returned `Buffer`
differently based on what arguments are provided:

* Passing a number as the first argument to `Buffer()` (e.g. `new Buffer(10)`),
* Passing a number as the first argument to `Buffer()` (for example: `new Buffer(10)`),
allocates a new `Buffer` object of the specified size. Prior to Node.js 8.0.0,
the memory allocated for such `Buffer` instances is *not* initialized and
*can contain sensitive data*. Such `Buffer` instances *must* be subsequently
Expand Down Expand Up @@ -703,7 +703,7 @@ Returns the actual byte length of a string. This is not the same as
a string.

*Note*: For `'base64'` and `'hex'`, this function assumes valid input. For
strings that contain non-Base64/Hex-encoded data (e.g. whitespace), the return
strings that contain non-Base64/Hex-encoded data (for example: whitespace), the return
value might be greater than the length of a `Buffer` created from the string.

Example:
Expand Down
2 changes: 1 addition & 1 deletion doc/api/child_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@ The `'disconnect'` event will be emitted when there are no messages in the
process of being received. This will most often be triggered immediately after
calling `subprocess.disconnect()`.

Note that when the child process is a Node.js instance (e.g. spawned using
Note that when the child process is a Node.js instance (for example: spawned using
[`child_process.fork()`]), the `process.disconnect()` method can be invoked
within the child process to close the IPC channel as well.

Expand Down
4 changes: 2 additions & 2 deletions doc/api/cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ added: v0.11.2
-->

* `code` {number} The exit code, if it exited normally.
* `signal` {string} The name of the signal (e.g. `'SIGHUP'`) that caused
* `signal` {string} The name of the signal (for example: `'SIGHUP'`) that caused
the process to be killed.

Similar to the `cluster.on('exit')` event, but specific to this worker.
Expand Down Expand Up @@ -482,7 +482,7 @@ added: v0.7.9

* `worker` {cluster.Worker}
* `code` {number} The exit code, if it exited normally.
* `signal` {string} The name of the signal (e.g. `'SIGHUP'`) that caused
* `signal` {string} The name of the signal (for example: `'SIGHUP'`) that caused
the process to be killed.

When any of the workers die the cluster module will emit the `'exit'` event.
Expand Down
2 changes: 1 addition & 1 deletion doc/api/console.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ console.error('error', code);
// Prints: error 5, to stderr
```

If formatting elements (e.g. `%d`) are not found in the first string then
If formatting elements (for example: `%d`) are not found in the first string then
[`util.inspect()`][] is called on each argument and the resulting string
values are concatenated. See [`util.format()`][] for more information.

Expand Down
4 changes: 2 additions & 2 deletions doc/api/crypto.md
Original file line number Diff line number Diff line change
Expand Up @@ -1264,7 +1264,7 @@ In line with OpenSSL's recommendation to use PBKDF2 instead of
[`EVP_BytesToKey`][] it is recommended that developers derive a key and IV on
their own using [`crypto.pbkdf2()`][] and to use [`crypto.createCipheriv()`][]
to create the `Cipher` object. Users should not use ciphers with counter mode
(e.g. CTR, GCM, or CCM) in `crypto.createCipher()`. A warning is emitted when
(for example: CTR, GCM, or CCM) in `crypto.createCipher()`. A warning is emitted when
they are used in order to avoid the risk of IV reuse that causes
vulnerabilities. For the case when IV is reused in GCM, see [Nonce-Disrespecting
Adversaries][] for details.
Expand Down Expand Up @@ -2015,7 +2015,7 @@ The Crypto module was added to Node.js before there was the concept of a
unified Stream API, and before there were [`Buffer`][] objects for handling
binary data. As such, the many of the `crypto` defined classes have methods not
typically found on other Node.js classes that implement the [streams][stream]
API (e.g. `update()`, `final()`, or `digest()`). Also, many methods accepted
API (for example: `update()`, `final()`, or `digest()`). Also, many methods accepted
and returned `'latin1'` encoded strings by default rather than Buffers. This
default was changed after Node.js v0.8 to use [`Buffer`][] objects by default
instead.
Expand Down
3 changes: 1 addition & 2 deletions doc/api/debugger.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@ V8 Inspector integration allows attaching Chrome DevTools to Node.js
instances for debugging and profiling. It uses the [Chrome Debugging Protocol][].

V8 Inspector can be enabled by passing the `--inspect` flag when starting a
Node.js application. It is also possible to supply a custom port with that flag,
e.g. `--inspect=9222` will accept DevTools connections on port 9222.
Node.js application. It is also possible to supply a custom port with that flag,for example: `--inspect=9222` will accept DevTools connections on port 9222.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please get rid of the comma and put the the whole example in parentheses.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Trott Thanks. Done!!


To break on the first line of the application code, pass the `--inspect-brk`
flag instead of `--inspect`.
Expand Down
2 changes: 1 addition & 1 deletion doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ Type: Documentation-only

The `http` module `outgoingMessage._headers` and `outgoingMessage._headerNames`
properties have been deprecated. Please instead use one of the public methods
(e.g. `outgoingMessage.getHeader()`, `outgoingMessage.getHeaders()`,
(for example: `outgoingMessage.getHeader()`, `outgoingMessage.getHeaders()`,
`outgoingMessage.getHeaderNames()`, `outgoingMessage.hasHeader()`,
`outgoingMessage.removeHeader()`, `outgoingMessage.setHeader()`) for working
with outgoing headers.
Expand Down
4 changes: 2 additions & 2 deletions doc/api/dgram.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ useful.
A bound datagram socket keeps the Node.js process running to receive
datagram messages.

If binding fails, an `'error'` event is generated. In rare case (e.g.
If binding fails, an `'error'` event is generated. In rare case (for example:
attempting to bind with a closed socket), an [`Error`][] may be thrown.

Example of a UDP server listening on port 41234:
Expand Down Expand Up @@ -189,7 +189,7 @@ port sharing results in an error.
A bound datagram socket keeps the Node.js process running to receive
datagram messages.

If binding fails, an `'error'` event is generated. In rare case (e.g.
If binding fails, an `'error'` event is generated. In rare case (for example:
attempting to bind with a closed socket), an [`Error`][] may be thrown.

An example socket listening on an exclusive port is shown below.
Expand Down
20 changes: 10 additions & 10 deletions doc/api/dns.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dns.lookup('iana.org', (err, address, family) => {
and that _always_ use the network to perform DNS queries. This category
contains all functions in the `dns` module _except_ [`dns.lookup()`][]. These
functions do not use the same set of configuration files used by
[`dns.lookup()`][] (e.g. `/etc/hosts`). These functions should be used by
[`dns.lookup()`][] (for example: `/etc/hosts`). These functions should be used by
developers who do not want to use the underlying operating system's facilities
for name resolution, and instead want to _always_ perform DNS queries.

Expand Down Expand Up @@ -153,7 +153,7 @@ changes:
- `address` {string} A string representation of an IPv4 or IPv6 address.
- `family` {integer} `4` or `6`, denoting the family of `address`.

Resolves a hostname (e.g. `'nodejs.org'`) into the first found A (IPv4) or
Resolves a hostname (for example: `'nodejs.org'`) into the first found A (IPv4) or
AAAA (IPv6) record. All `option` properties are optional. If `options` is an
integer, then it must be `4` or `6` – if `options` is not provided, then IPv4
and IPv6 addresses are both returned if found.
Expand Down Expand Up @@ -217,8 +217,8 @@ added: v0.11.14
- `port` {number}
- `callback` {Function}
- `err` {Error}
- `hostname` {string} e.g. `example.com`
- `service` {string} e.g. `http`
- `hostname` {string} for example: `example.com`
- `service` {string} for example: `http`

Resolves the given `address` and `port` into a hostname and service using
the operating system's underlying `getnameinfo` implementation.
Expand Down Expand Up @@ -250,7 +250,7 @@ added: v0.1.27
- `err` {Error}
- `records` {string[] | Object[] | Object}

Uses the DNS protocol to resolve a hostname (e.g. `'nodejs.org'`) into an array
Uses the DNS protocol to resolve a hostname (for example: `'nodejs.org'`) into an array
of the resource records. The `callback` function has arguments
`(err, records)`. When successful, `records` will be an array of resource
records. The type and structure of individual results varies based on `rrtype`:
Expand Down Expand Up @@ -293,7 +293,7 @@ changes:

Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the
`hostname`. The `addresses` argument passed to the `callback` function
will contain an array of IPv4 addresses (e.g.
will contain an array of IPv4 addresses (for example:
`['74.125.79.104', '74.125.79.105', '74.125.79.106']`).


Expand Down Expand Up @@ -333,7 +333,7 @@ added: v0.3.2
Uses the DNS protocol to resolve `CNAME` records for the `hostname`. The
`addresses` argument passed to the `callback` function
will contain an array of canonical name records available for the `hostname`
(e.g. `['bar.example.com']`).
(for example: `['bar.example.com']`).

## dns.resolveMx(hostname, callback)
<!-- YAML
Expand All @@ -347,7 +347,7 @@ added: v0.1.27
Uses the DNS protocol to resolve mail exchange records (`MX` records) for the
`hostname`. The `addresses` argument passed to the `callback` function will
contain an array of objects containing both a `priority` and `exchange`
property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`).
property (for example: `[{priority: 10, exchange: 'mx.example.com'}, ...]`).

## dns.resolveNaptr(hostname, callback)
<!-- YAML
Expand Down Expand Up @@ -395,7 +395,7 @@ added: v0.1.90
Uses the DNS protocol to resolve name server records (`NS` records) for the
`hostname`. The `addresses` argument passed to the `callback` function will
contain an array of name server records available for `hostname`
(e.g. `['ns1.example.com', 'ns2.example.com']`).
(for example: `['ns1.example.com', 'ns2.example.com']`).

## dns.resolvePtr(hostname, callback)
<!-- YAML
Expand Down Expand Up @@ -483,7 +483,7 @@ added: v0.1.27

Uses the DNS protocol to resolve text queries (`TXT` records) for the
`hostname`. The `records` argument passed to the `callback` function is a
two-dimensional array of the text records available for `hostname` (e.g.
two-dimensional array of the text records available for `hostname` (for example:
`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of
one record. Depending on the use case, these could be either joined together or
treated separately.
Expand Down
12 changes: 6 additions & 6 deletions doc/api/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -517,21 +517,21 @@ The `error.syscall` property is a string describing the [syscall][] that failed.

* {string}

When present (e.g. in `fs` or `child_process`), the `error.path` property is a
When present (for example: in `fs` or `child_process`), the `error.path` property is a
string containing a relevant invalid pathname.

#### error.address

* {string}

When present (e.g. in `net` or `dgram`), the `error.address` property is a
When present (for example: in `net` or `dgram`), the `error.address` property is a
string describing the address to which the connection failed.

#### error.port

* {number}

When present (e.g. in `net` or `dgram`), the `error.port` property is a number
When present (for example: in `net` or `dgram`), the `error.port` property is a number
representing the connection's port that is not available.

### Common System Errors
Expand Down Expand Up @@ -707,7 +707,7 @@ available.
The UTF-16 encoding was used with [`hash.digest()`][]. While the
`hash.digest()` method does allow an `encoding` argument to be passed in,
causing the method to return a string rather than a `Buffer`, the UTF-16
encoding (e.g. `ucs` or `utf16le`) is not supported.
encoding (for example: `ucs` or `utf16le`) is not supported.

<a id="ERR_CRYPTO_HASH_FINALIZED"></a>
### ERR_CRYPTO_HASH_FINALIZED
Expand Down Expand Up @@ -1047,7 +1047,7 @@ made to mark a stream and dependent of itself.
<a id="ERR_INDEX_OUT_OF_RANGE"></a>
### ERR_INDEX_OUT_OF_RANGE

A given index was out of the accepted range (e.g. negative offsets).
A given index was out of the accepted range (for example: negative offsets).

<a id="ERR_INSPECTOR_ALREADY_CONNECTED"></a>
### ERR_INSPECTOR_ALREADY_CONNECTED
Expand Down Expand Up @@ -1123,7 +1123,7 @@ specified column.
<a id="ERR_INVALID_FD"></a>
### ERR_INVALID_FD

A file descriptor ('fd') was not valid (e.g. it was a negative value).
A file descriptor ('fd') was not valid (for example: it was a negative value).

<a id="ERR_INVALID_FD_TYPE"></a>
### ERR_INVALID_FD_TYPE
Expand Down
2 changes: 1 addition & 1 deletion doc/api/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ Removes all listeners, or those of the specified `eventName`.

Note that it is bad practice to remove listeners added elsewhere in the code,
particularly when the `EventEmitter` instance was created by some other
component or module (e.g. sockets or file streams).
component or module (for example: sockets or file streams).

Returns a reference to the `EventEmitter`, so that calls can be chained.

Expand Down
Loading