Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
doc: change e.g to for example in api docs
  • Loading branch information
sreepurnajasti committed Jan 26, 2018
commit bf93260a1e0f033b9617f9a4c42cdfd3091b700a
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
Copy Markdown
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
Copy Markdown
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
8 changes: 4 additions & 4 deletions doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ Tests a user's permissions for the file or directory specified by `path`.
The `mode` argument is an optional integer that specifies the accessibility
checks to be performed. The following constants define the possible values of
`mode`. It is possible to create a mask consisting of the bitwise OR of two or
more values (e.g. `fs.constants.W_OK | fs.constants.R_OK`).
more values (for example: `fs.constants.W_OK | fs.constants.R_OK`).

* `fs.constants.F_OK` - `path` is visible to the calling process. This is useful
for determining if a file exists, but says nothing about `rwx` permissions.
Expand Down Expand Up @@ -805,7 +805,7 @@ Synchronously tests a user's permissions for the file or directory specified by
`path`. The `mode` argument is an optional integer that specifies the
accessibility checks to be performed. The following constants define the
possible values of `mode`. It is possible to create a mask consisting of the
bitwise OR of two or more values (e.g. `fs.constants.W_OK | fs.constants.R_OK`).
bitwise OR of two or more values (for example: `fs.constants.W_OK | fs.constants.R_OK`).

* `fs.constants.F_OK` - `path` is visible to the calling process. This is useful
for determining if a file exists, but says nothing about `rwx` permissions.
Expand Down Expand Up @@ -986,7 +986,7 @@ constants:
| `fs.constants.S_IXOTH` | `0o1` | execute/search by others |

An easier method of constructing the `mode` is to use a sequence of three
octal digits (e.g. `765`). The left-most digit (`7` in the example), specifies
octal digits (for example: `765`). The left-most digit (`7` in the example), specifies
the permissions for the file owner. The middle digit (`6` in the example),
specifies permissions for the group. The right-most digit (`5` in the example),
specifies the permissions for others.
Expand Down Expand Up @@ -2032,7 +2032,7 @@ systems.

`flags` can also be a number as documented by open(2); commonly used constants
are available from `fs.constants`. On Windows, flags are translated to
their equivalent ones where applicable, e.g. `O_WRONLY` to `FILE_GENERIC_WRITE`,
their equivalent ones where applicable, for example: `O_WRONLY` to `FILE_GENERIC_WRITE`,
or `O_EXCL|O_CREAT` to `CREATE_NEW`, as accepted by CreateFileW.

On Linux, positional writes don't work when the file is opened in append mode.
Expand Down
4 changes: 2 additions & 2 deletions doc/api/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ with a `100 Continue` as appropriate.

Handling this event involves calling [`response.writeContinue()`][] if the client
should continue to send the request body, or generating an appropriate HTTP
response (e.g. 400 Bad Request) if the client should not continue to send the
response (for example: 400 Bad Request) if the client should not continue to send the
request body.

Note that when this event is emitted and handled, the [`'request'`][] event will
Expand Down Expand Up @@ -978,7 +978,7 @@ This method adds HTTP trailing headers (a header but at the end of the
message) to the response.

Trailers will **only** be emitted if chunked encoding is used for the
response; if it is not (e.g. if the request was HTTP/1.0), they will
response; if it is not (for example: if the request was HTTP/1.0), they will
be silently discarded.

Note that HTTP requires the `Trailer` header to be sent in order to
Expand Down
Loading