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
squash! change the style to italic
  • Loading branch information
aqrln committed May 24, 2017
commit 2dc7c148f92cf426729e63b877389e274ec34fcd
2 changes: 1 addition & 1 deletion doc/STYLE_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
* References to methods should be used with parentheses: for example,
`socket.end()` instead of `socket.end`.
* To draw special attention to a note, adhere to the following guidelines:
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.

To be quite honest, I generally prefer the *Note*: style and have been incrementally working towards that for quite some time. I guess this is fine tho. Mildly -0

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.

As I said,

I don't have any strong opinions about the notes style except that it should be only one, so the formatting may be discussed in this PR.

I am completely fine with changing the style to what you prefer, a Vim macro will chew it easily 😄

* Make the "Note:" label bold, i.e. `**Note:**`.
* Make the "Note:" label italic, i.e. `*Note*:`.
* Use a capital letter after the "Note:" label.
* Preferably, make the note a new paragraph for better visual distinction.

Expand Down
2 changes: 1 addition & 1 deletion doc/api/addons.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ specifically to compile Node.js Addons.
}
```

**Note:** A version of the `node-gyp` utility is bundled and distributed with
*Note*: A version of the `node-gyp` utility is bundled and distributed with
Node.js as part of `npm`. This version is not made directly available for
developers to use and is intended only to support the ability to use the
`npm install` command to compile and install Addons. Developers who wish to
Expand Down
6 changes: 3 additions & 3 deletions doc/api/buffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ The character encodings currently supported by Node.js include:

* `'hex'` - Encode each byte as two hexadecimal characters.

**Note:** Today's browsers follow the [WHATWG spec] which aliases both 'latin1'
*Note*: Today's browsers follow the [WHATWG spec] which aliases both 'latin1'
and ISO-8859-1 to win-1252. This means that while doing something like
`http.get()`, if the returned charset is one of those listed in the WHATWG spec
it's possible that the server actually returned win-1252-encoded data, and
Expand Down Expand Up @@ -686,7 +686,7 @@ Returns the actual byte length of a string. This is not the same as
[`String.prototype.length`] since that returns the number of *characters* in
a string.

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

Expand Down Expand Up @@ -1868,7 +1868,7 @@ changes:
Returns a new `Buffer` that references the same memory as the original, but
offset and cropped by the `start` and `end` indices.

**Note:** Modifying the new `Buffer` slice will modify the memory in the
*Note*: Modifying the new `Buffer` slice will modify the memory in the
original `Buffer` because the allocated memory of the two objects overlap.

Example: Create a `Buffer` with the ASCII alphabet, take a slice, and then modify
Expand Down
22 changes: 11 additions & 11 deletions doc/api/child_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ exec('echo "The \\$HOME variable is $HOME"');
//The $HOME variable is escaped in the first instance, but not in the second
```

**Note:** Never pass unsanitised user input to this function. Any input
*Note*: Never pass unsanitised user input to this function. Any input
containing shell metacharacters may be used to trigger arbitrary command
execution.

Expand Down Expand Up @@ -211,7 +211,7 @@ If `timeout` is greater than `0`, the parent will send the signal
identified by the `killSignal` property (the default is `'SIGTERM'`) if the
child runs longer than `timeout` milliseconds.

**Note:** Unlike the exec(3) POSIX system call, `child_process.exec()` does not
*Note*: Unlike the exec(3) POSIX system call, `child_process.exec()` does not
replace the existing process and uses a shell to execute the command.

If this method is invoked as its [`util.promisify()`][]ed version, it returns
Expand Down Expand Up @@ -348,7 +348,7 @@ parent process using the file descriptor (fd) identified using the
environment variable `NODE_CHANNEL_FD` on the child process. The input and
output on this fd is expected to be line delimited JSON objects.

**Note:** Unlike the fork(2) POSIX system call, `child_process.fork()` does
*Note*: Unlike the fork(2) POSIX system call, `child_process.fork()` does
not clone the current process.

### child_process.spawn(command[, args][, options])
Expand Down Expand Up @@ -387,7 +387,7 @@ The `child_process.spawn()` method spawns a new process using the given
`command`, with command line arguments in `args`. If omitted, `args` defaults
to an empty array.

**Note:** If the `shell` option is enabled, do not pass unsanitised user input to
*Note*: If the `shell` option is enabled, do not pass unsanitised user input to
this function. Any input containing shell metacharacters may be used to
trigger arbitrary command execution.

Expand Down Expand Up @@ -476,10 +476,10 @@ child.on('error', (err) => {
});
```

**Note:** Certain platforms (macOS, Linux) will use the value of `argv[0]` for
*Note*: Certain platforms (macOS, Linux) will use the value of `argv[0]` for
the process title while others (Windows, SunOS) will use `command`.

**Note:** Node.js currently overwrites `argv[0]` with `process.execPath` on
*Note*: Node.js currently overwrites `argv[0]` with `process.execPath` on
startup, so `process.argv[0]` in a Node.js child process will not match the
`argv0` parameter passed to `spawn` from the parent, retrieve it with the
`process.argv0` property instead.
Expand Down Expand Up @@ -675,7 +675,7 @@ until the child process has fully closed. When a timeout has been encountered
and `killSignal` is sent, the method won't return until the process has
completely exited.

**Note:** If the child process intercepts and handles the `SIGTERM` signal and
*Note*: If the child process intercepts and handles the `SIGTERM` signal and
does not exit, the parent process will still wait until the child process has
exited.

Expand Down Expand Up @@ -731,7 +731,7 @@ If the process times out, or has a non-zero exit code, this method ***will***
throw. The [`Error`][] object will contain the entire result from
[`child_process.spawnSync()`][]

**Note:** Never pass unsanitised user input to this function. Any input
*Note*: Never pass unsanitised user input to this function. Any input
containing shell metacharacters may be used to trigger arbitrary command
execution.

Expand Down Expand Up @@ -791,7 +791,7 @@ completely exited. Note that if the process intercepts and handles the
`SIGTERM` signal and doesn't exit, the parent process will wait until the child
process has exited.

**Note:** If the `shell` option is enabled, do not pass unsanitised user input
*Note*: If the `shell` option is enabled, do not pass unsanitised user input
to this function. Any input containing shell metacharacters may be used to
trigger arbitrary command execution.

Expand Down Expand Up @@ -840,7 +840,7 @@ The `'error'` event is emitted whenever:
2. The process could not be killed, or
3. Sending a message to the child process failed.

**Note:** The `'exit'` event may or may not fire after an error has occurred.
*Note*: The `'exit'` event may or may not fire after an error has occurred.
When listening to both the `'exit'` and `'error'` events, it is important
to guard against accidentally invoking handler functions multiple times.

Expand Down Expand Up @@ -1168,7 +1168,7 @@ tracking when the socket is destroyed. To indicate this, the `.connections`
property becomes `null`. It is recommended not to use `.maxConnections` when
this occurs.

**Note:** This function uses [`JSON.stringify()`][] internally to serialize the
*Note*: This function uses [`JSON.stringify()`][] internally to serialize the
`message`.

### child.stderr
Expand Down
12 changes: 6 additions & 6 deletions doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ added: REPLACEME

Emit pending deprecation warnings.

**Note:** Pending deprecations are generally identical to a runtime deprecation
*Note*: Pending deprecations are generally identical to a runtime deprecation
with the notable exception that they are turned *off* by default and will not
be emitted unless either the `--pending-deprecation` command line flag, or the
`NODE_PENDING_DEPRECATION=1` environment variable, is set. Pending deprecations
Expand Down Expand Up @@ -278,7 +278,7 @@ added: v0.1.3

Print v8 command line options.

**Note:** V8 options allow words to be separated by both dashes (`-`) or
*Note*: V8 options allow words to be separated by both dashes (`-`) or
underscores (`_`).

For example, `--stack-trace-limit` is equivalent to `--stack_trace_limit`.
Expand Down Expand Up @@ -382,7 +382,7 @@ added: v0.1.32

`':'`-separated list of directories prefixed to the module search path.

**Note:** On Windows, this is a `';'`-separated list instead.
*Note*: On Windows, this is a `';'`-separated list instead.


### `NODE_DISABLE_COLORS=1`
Expand Down Expand Up @@ -453,7 +453,7 @@ added: REPLACEME

When set to `1`, emit pending deprecation warnings.

**Note:** Pending deprecations are generally identical to a runtime deprecation
*Note*: Pending deprecations are generally identical to a runtime deprecation
with the notable exception that they are turned *off* by default and will not
be emitted unless either the `--pending-deprecation` command line flag, or the
`NODE_PENDING_DEPRECATION=1` environment variable, is set. Pending deprecations
Expand Down Expand Up @@ -512,7 +512,7 @@ added: v7.7.0
If `--use-openssl-ca` is enabled, this overrides and sets OpenSSL's directory
containing trusted certificates.

**Note:** Be aware that unless the child environment is explicitly set, this
*Note*: Be aware that unless the child environment is explicitly set, this
evironment variable will be inherited by any child processes, and if they use
OpenSSL, it may cause them to trust the same CAs as node.

Expand All @@ -524,7 +524,7 @@ added: v7.7.0
If `--use-openssl-ca` is enabled, this overrides and sets OpenSSL's file
containing trusted certificates.

**Note:** Be aware that unless the child environment is explicitly set, this
*Note*: Be aware that unless the child environment is explicitly set, this
evironment variable will be inherited by any child processes, and if they use
OpenSSL, it may cause them to trust the same CAs as node.

Expand Down
2 changes: 1 addition & 1 deletion doc/api/cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Node.js process and a cluster worker differs:
port is random the first time, but predictable thereafter. To listen
on a unique port, generate a port number based on the cluster worker ID.

**Note:** Node.js does not provide routing logic. It is, therefore important to
*Note*: Node.js does not provide routing logic. It is, therefore important to
design an application such that it does not rely too heavily on in-memory data
objects for things like sessions and login.

Expand Down
4 changes: 2 additions & 2 deletions doc/api/console.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ console.assert(false, 'Whoops %s', 'didn\'t work');
// AssertionError: Whoops didn't work
```

**Note:** The `console.assert()` method is implemented differently in Node.js
*Note*: The `console.assert()` method is implemented differently in Node.js
than the `console.assert()` method [available in browsers][web-api-assert].

Specifically, in browsers, calling `console.assert()` with a falsy
Expand Down Expand Up @@ -282,7 +282,7 @@ console.timeEnd('100-elements');
// prints 100-elements: 225.438ms
```

**Note:** As of Node.js v6.0.0, `console.timeEnd()` deletes the timer to avoid
*Note*: As of Node.js v6.0.0, `console.timeEnd()` deletes the timer to avoid
leaking it. On older versions, the timer persisted. This allowed
`console.timeEnd()` to be called multiple times for the same label. This
functionality was unintended and is no longer supported.
Expand Down
2 changes: 1 addition & 1 deletion doc/api/crypto.md
Original file line number Diff line number Diff line change
Expand Up @@ -1820,7 +1820,7 @@ comparing HMAC digests or secret values like authentication cookies or
`a` and `b` must both be `Buffer`s, `TypedArray`s, or `DataView`s, and they
must have the same length.

**Note:** Use of `crypto.timingSafeEqual` does not guarantee that the
*Note*: Use of `crypto.timingSafeEqual` does not guarantee that the
*surrounding* code is timing-safe. Care should be taken to ensure that the
surrounding code does not introduce timing vulnerabilities.

Expand Down
8 changes: 4 additions & 4 deletions doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ Type: Documentation-only
The `http` module `ServerResponse.prototype.writeHeader()` API has been
deprecated. Please use `ServerResponse.prototype.writeHead()` instead.

**Note:** The `ServerResponse.prototype.writeHeader()` method was never
*Note*: The `ServerResponse.prototype.writeHeader()` method was never
documented as an officially supported API.

<a id="DEP0064"></a>
Expand Down Expand Up @@ -568,7 +568,7 @@ properties have been deprecated. Please instead use one of the public methods
`outgoingMessage.removeHeader()`, `outgoingMessage.setHeader()`) for working
with outgoing headers.

**Note:** `outgoingMessage._headers` and `outgoingMessage._headerNames` were
*Note*: `outgoingMessage._headers` and `outgoingMessage._headerNames` were
never documented as officially supported properties.

<a id="DEP0067"></a>
Expand All @@ -579,7 +579,7 @@ Type: Documentation-only
The `http` module `OutgoingMessage.prototype._renderHeaders()` API has been
deprecated.

**Note:** `OutgoingMessage.prototype._renderHeaders` was never documented as
*Note*: `OutgoingMessage.prototype._renderHeaders` was never documented as
an officially supported API.

<a id="DEP0068"></a>
Expand All @@ -598,7 +598,7 @@ Type: Documentation-only
The DebugContext will be removed in V8 soon and will not be available in Node
10+.

**Note:** DebugContext was an experimental API.
*Note*: DebugContext was an experimental API.

[`Buffer.allocUnsafeSlow(size)`]: buffer.html#buffer_class_method_buffer_allocunsafeslow_size
[`Buffer.from(array)`]: buffer.html#buffer_class_method_buffer_from_array
Expand Down
Loading