diff options
author | Rich Trott <rtrott@gmail.com> | 2021-07-10 20:33:54 +0300 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2021-07-13 01:21:36 +0300 |
commit | 5cccdccf883f1ffbb03398624bb51b7760f0bbdd (patch) | |
tree | 3649de6ec6ee2403a72279b57c430678ffe913e7 /doc/api | |
parent | 3fd04e789e569479de412b0c8a1265233bbb7115 (diff) |
doc: use consistent abbreviation formatting
Refs: https://docs.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/term-collections/bits-bytes-terms
PR-URL: https://github.com/nodejs/node/pull/39343
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Diffstat (limited to 'doc/api')
-rw-r--r-- | doc/api/buffer.md | 6 | ||||
-rw-r--r-- | doc/api/cli.md | 8 | ||||
-rw-r--r-- | doc/api/errors.md | 4 | ||||
-rw-r--r-- | doc/api/fs.md | 4 | ||||
-rw-r--r-- | doc/api/http.md | 7 | ||||
-rw-r--r-- | doc/api/stream.md | 6 |
6 files changed, 18 insertions, 17 deletions
diff --git a/doc/api/buffer.md b/doc/api/buffer.md index bd6057f3999..0db0a455715 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -785,7 +785,7 @@ initialized*. The contents of the newly created `Buffer` are unknown and such `Buffer` instances with zeroes. When using [`Buffer.allocUnsafe()`][] to allocate new `Buffer` instances, -allocations under 4KB are sliced from a single pre-allocated `Buffer`. This +allocations under 4 KB are sliced from a single pre-allocated `Buffer`. This allows applications to avoid the garbage collection overhead of creating many individually allocated `Buffer` instances. This approach improves both performance and memory usage by eliminating the need to track and clean up as @@ -5031,9 +5031,9 @@ changes: * {integer} The largest size allowed for a single `Buffer` instance. -On 32-bit architectures, this value currently is 2<sup>30</sup> - 1 (~1GB). +On 32-bit architectures, this value currently is 2<sup>30</sup> - 1 (~1 GB). -On 64-bit architectures, this value currently is 2<sup>32</sup> (~4GB). +On 64-bit architectures, this value currently is 2<sup>32</sup> (~4 GB). It reflects [`v8::TypedArray::kMaxLength`][] under the hood. diff --git a/doc/api/cli.md b/doc/api/cli.md index f4f0ed4e98b..1a2d444898d 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -586,10 +586,10 @@ added: changes: - version: v13.13.0 pr-url: https://github.com/nodejs/node/pull/32520 - description: Change maximum default size of HTTP headers from 8KB to 16KB. + description: Change maximum default size of HTTP headers from 8 KB to 16 KB. --> -Specify the maximum size, in bytes, of HTTP headers. Defaults to 16KB. +Specify the maximum size, in bytes, of HTTP headers. Defaults to 16 KB. ### `--napi-modules` <!-- YAML @@ -1760,8 +1760,8 @@ Sets the max memory size of V8's old memory section. As memory consumption approaches the limit, V8 will spend more time on garbage collection in an effort to free unused memory. -On a machine with 2GB of memory, consider setting this to -1536 (1.5GB) to leave some memory for other uses and avoid swapping. +On a machine with 2 GB of memory, consider setting this to +1536 (1.5 GB) to leave some memory for other uses and avoid swapping. ```console $ node --max-old-space-size=1536 index.js diff --git a/doc/api/errors.md b/doc/api/errors.md index d7df19cf7f0..140dad7c86d 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -2456,11 +2456,11 @@ changes: - v10.15.0 commit: 186035243fad247e3955f pr-url: https://github.com/nodejs-private/node-private/pull/143 - description: Max header size in `http_parser` was set to 8KB. + description: Max header size in `http_parser` was set to 8 KB. --> Too much HTTP header data was received. In order to protect against malicious or -malconfigured clients, if more than 8KB of HTTP header data is received then +malconfigured clients, if more than 8 KB of HTTP header data is received then HTTP parsing will abort without a request or response object being created, and an `Error` with this code will be emitted. diff --git a/doc/api/fs.md b/doc/api/fs.md index ab5d7f08e10..fb710b8c84f 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -2966,8 +2966,8 @@ to read a complete file into memory. The additional read overhead can vary broadly on different systems and depends on the type of file being read. If the file type is not a regular file (a pipe for instance) and Node.js is unable to determine an actual file size, each read -operation will load on 64kb of data. For regular files, each read will process -512kb of data. +operation will load on 64 KB of data. For regular files, each read will process +512 KB of data. For applications that require as-fast-as-possible reading of file contents, it is better to use `fs.read()` directly and for application code to manage diff --git a/doc/api/http.md b/doc/api/http.md index 24a0a92f47e..84e98f5ff79 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -2683,7 +2683,7 @@ changes: * `maxHeaderSize` {number} Optionally overrides the value of [`--max-http-header-size`][] for requests received by this server, i.e. the maximum length of request headers in bytes. - **Default:** 16384 (16KB). + **Default:** 16384 (16 KB). * `requestListener` {Function} * Returns: {http.Server} @@ -2793,7 +2793,8 @@ added: * {number} Read-only property specifying the maximum allowed size of HTTP headers in bytes. -Defaults to 8KB. Configurable using the [`--max-http-header-size`][] CLI option. +Defaults to 8 KB. Configurable using the [`--max-http-header-size`][] CLI +option. This can be overridden for servers and client requests by passing the `maxHeaderSize` option. @@ -2861,7 +2862,7 @@ changes: * `maxHeaderSize` {number} Optionally overrides the value of [`--max-http-header-size`][] for requests received from the server, i.e. the maximum length of response headers in bytes. - **Default:** 16384 (16KB). + **Default:** 16384 (16 KB). * `method` {string} A string specifying the HTTP request method. **Default:** `'GET'`. * `path` {string} Request path. Should include query string if any. diff --git a/doc/api/stream.md b/doc/api/stream.md index 63f444ec796..47e1e04441d 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -1511,7 +1511,7 @@ If the loop terminates with a `break`, `return`, or a `throw`, the stream will be destroyed. In other terms, iterating over a stream will consume the stream fully. The stream will be read in chunks of size equal to the `highWaterMark` option. In the code example above, data will be in a single chunk if the file -has less then 64KB of data because no `highWaterMark` option is provided to +has less then 64 KB of data because no `highWaterMark` option is provided to [`fs.createReadStream()`][]. ##### `readable.iterator([options])` @@ -2052,7 +2052,7 @@ changes: * `options` {Object} * `highWaterMark` {number} Buffer level when [`stream.write()`][stream-write] starts returning `false`. **Default:** - `16384` (16KB), or `16` for `objectMode` streams. + `16384` (16 KB), or `16` for `objectMode` streams. * `decodeStrings` {boolean} Whether to encode `string`s passed to [`stream.write()`][stream-write] to `Buffer`s (with the encoding specified in the [`stream.write()`][stream-write] call) before passing @@ -2415,7 +2415,7 @@ changes: * `options` {Object} * `highWaterMark` {number} The maximum [number of bytes][hwm-gotcha] to store in the internal buffer before ceasing to read from the underlying resource. - **Default:** `16384` (16KB), or `16` for `objectMode` streams. + **Default:** `16384` (16 KB), or `16` for `objectMode` streams. * `encoding` {string} If specified, then buffers will be decoded to strings using the specified encoding. **Default:** `null`. * `objectMode` {boolean} Whether this stream should behave |