From 5cccdccf883f1ffbb03398624bb51b7760f0bbdd Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 10 Jul 2021 10:33:54 -0700 Subject: [PATCH] doc: use consistent abbreviation formatting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: Tobias Nießen Reviewed-By: Darshan Sen --- doc/api/buffer.md | 6 +++--- doc/api/cli.md | 8 ++++---- doc/api/errors.md | 4 ++-- doc/api/fs.md | 4 ++-- doc/api/http.md | 7 ++++--- doc/api/stream.md | 6 +++--- doc/guides/investigating_native_memory_leak.md | 4 ++-- doc/node.1 | 2 +- 8 files changed, 21 insertions(+), 20 deletions(-) diff --git a/doc/api/buffer.md b/doc/api/buffer.md index bd6057f39999ec..0db0a4557156e1 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 230 - 1 (~1GB). +On 32-bit architectures, this value currently is 230 - 1 (~1 GB). -On 64-bit architectures, this value currently is 232 (~4GB). +On 64-bit architectures, this value currently is 232 (~4 GB). It reflects [`v8::TypedArray::kMaxLength`][] under the hood. diff --git a/doc/api/cli.md b/doc/api/cli.md index f4f0ed4e98b971..1a2d444898d9cc 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` 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 ab5d7f08e1082f..fb710b8c84f939 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 24a0a92f47e387..84e98f5ff79d1e 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 63f444ec796655..47e1e04441d6d6 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 diff --git a/doc/guides/investigating_native_memory_leak.md b/doc/guides/investigating_native_memory_leak.md index 55ba1b1ec3d60b..3c5664a77812c1 100644 --- a/doc/guides/investigating_native_memory_leak.md +++ b/doc/guides/investigating_native_memory_leak.md @@ -92,7 +92,7 @@ operating systems will clean up the memory of the process after the shutdown while attempting to free all memory to get a clean report may have a negative impact on the code complexity and shutdown times. Node.js does a pretty good job only leaving on -the order of 6KB that are not freed on shutdown. +the order of 6 KB that are not freed on shutdown. ## An obvious memory leak @@ -100,7 +100,7 @@ Leaks can be introduced in native addons and the following is a simple example leak based on the "Hello world" addon from [node-addon-examples](https://github.com/nodejs/node-addon-examples). -In this example, a loop which allocates ~1MB of memory and never frees it +In this example, a loop which allocates ~1 MB of memory and never frees it has been added: ```cpp diff --git a/doc/node.1 b/doc/node.1 index a0bbb2b781b7ba..58c76663c2f42f 100644 --- a/doc/node.1 +++ b/doc/node.1 @@ -266,7 +266,7 @@ This flag is inherited from V8 and is subject to change upstream. It may disappear in a non-semver-major release. . .It Fl -max-http-header-size Ns = Ns Ar size -Specify the maximum size of HTTP headers in bytes. Defaults to 16KB. +Specify the maximum size of HTTP headers in bytes. Defaults to 16 KB. . .It Fl -napi-modules This option is a no-op.