diff options
author | Gibson Fahnestock <gibfahn@gmail.com> | 2017-06-18 22:53:54 +0300 |
---|---|---|
committer | Myles Borins <mylesborins@google.com> | 2017-10-11 09:05:28 +0300 |
commit | 9c247c56ab831ab99faa2b7f012b76698b3d1a22 (patch) | |
tree | 7c86a7b32ab2d42bccef9a81fa7534c2d2f52077 /doc/api/buffer.md | |
parent | 827f843dfa8eab36d54469a54a79e8fe82fed973 (diff) |
doc: standardize function param/object prop style
PR-URL: https://github.com/nodejs/node/pull/13769
Backport-PR-URL: https://github.com/nodejs/node/pull/15687
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'doc/api/buffer.md')
-rw-r--r-- | doc/api/buffer.md | 168 |
1 files changed, 84 insertions, 84 deletions
diff --git a/doc/api/buffer.md b/doc/api/buffer.md index 0b01370f90f..cc3992b9517 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -172,7 +172,7 @@ console.log(buf.toString('base64')); The character encodings currently supported by Node.js include: -* `'ascii'` - for 7-bit ASCII data only. This encoding is fast and will strip +* `'ascii'` - For 7-bit ASCII data only. This encoding is fast and will strip the high bit if set. * `'utf8'` - Multibyte encoded Unicode characters. Many web pages and other @@ -330,7 +330,7 @@ changes: > Stability: 0 - Deprecated: Use [`Buffer.from(array)`] instead. -* `array` {Array} An array of bytes to copy from +* `array` {integer[]} An array of bytes to copy from. Allocates a new `Buffer` using an `array` of octets. @@ -410,7 +410,7 @@ changes: > Stability: 0 - Deprecated: Use [`Buffer.from(buffer)`] instead. -* `buffer` {Buffer} An existing `Buffer` to copy data from +* `buffer` {Buffer} An existing `Buffer` to copy data from. Copies the passed `buffer` data onto a new `Buffer` instance. @@ -447,7 +447,7 @@ changes: > Stability: 0 - Deprecated: Use [`Buffer.alloc()`] instead (also see > [`Buffer.allocUnsafe()`]). -* `size` {integer} The desired length of the new `Buffer` +* `size` {integer} The desired length of the new `Buffer`. Allocates a new `Buffer` of `size` bytes. If the `size` is larger than [`buffer.constants.MAX_LENGTH`] or smaller than 0, a [`RangeError`] will be @@ -483,7 +483,7 @@ changes: > Stability: 0 - Deprecated: > Use [`Buffer.from(string[, encoding])`][`Buffer.from(string)`] instead. -* `string` {string} String to encode +* `string` {string} String to encode. * `encoding` {string} The encoding of `string`. **Default:** `'utf8'` Creates a new `Buffer` containing the given JavaScript string `string`. If @@ -512,7 +512,7 @@ console.log(buf2.toString()); added: v5.10.0 --> -* `size` {integer} The desired length of the new `Buffer` +* `size` {integer} The desired length of the new `Buffer`. * `fill` {string|Buffer|integer} A value to pre-fill the new `Buffer` with. **Default:** `0` * `encoding` {string} If `fill` is a string, this is its encoding. @@ -573,7 +573,7 @@ changes: description: Passing a negative `size` will now throw an error. --> -* `size` {integer} The desired length of the new `Buffer` +* `size` {integer} The desired length of the new `Buffer`. Allocates a new `Buffer` of `size` bytes. If the `size` is larger than [`buffer.constants.MAX_LENGTH`] or smaller than 0, a [`RangeError`] will be @@ -619,7 +619,7 @@ additional performance that [`Buffer.allocUnsafe()`] provides. added: v5.12.0 --> -* `size` {integer} The desired length of the new `Buffer` +* `size` {integer} The desired length of the new `Buffer`. Allocates a new `Buffer` of `size` bytes. If the `size` is larger than [`buffer.constants.MAX_LENGTH`] or smaller than 0, a [`RangeError`] will be @@ -680,10 +680,10 @@ changes: --> * `string` {string|Buffer|TypedArray|DataView|ArrayBuffer} A value to - calculate the length of + calculate the length of. * `encoding` {string} If `string` is a string, this is its encoding. **Default:** `'utf8'` -* Returns: {integer} The number of bytes contained within `string` +* Returns: {integer} The number of bytes contained within `string`. 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 @@ -744,9 +744,9 @@ changes: description: The elements of `list` can now be `Uint8Array`s. --> -* `list` {Array} List of `Buffer` or [`Uint8Array`] instances to concat +* `list` {Array} List of `Buffer` or [`Uint8Array`] instances to concat. * `totalLength` {integer} Total length of the `Buffer` instances in `list` - when concatenated + when concatenated. * Returns: {Buffer} Returns a new `Buffer` which is the result of concatenating all the `Buffer` @@ -859,7 +859,7 @@ A `TypeError` will be thrown if `arrayBuffer` is not an [`ArrayBuffer`]. added: v5.10.0 --> -* `buffer` {Buffer} An existing `Buffer` to copy data from +* `buffer` {Buffer} An existing `Buffer` to copy data from. Copies the passed `buffer` data onto a new `Buffer` instance. @@ -964,7 +964,7 @@ Returns `true` if `obj` is a `Buffer`, `false` otherwise. added: v0.9.1 --> -* `encoding` {string} A character encoding name to check +* `encoding` {string} A character encoding name to check. * Returns: {boolean} Returns `true` if `encoding` contains a supported character encoding, or `false` @@ -1033,7 +1033,7 @@ changes: description: Additional parameters for specifying offsets are supported now. --> -* `target` {Buffer|Uint8Array} A `Buffer` or [`Uint8Array`] to compare to +* `target` {Buffer|Uint8Array} A `Buffer` or [`Uint8Array`] to compare to. * `targetStart` {integer} The offset within `target` at which to begin comparison. **Default:** `0` * `targetEnd` {integer} The offset with `target` at which to end comparison @@ -1192,7 +1192,7 @@ changes: description: The arguments can now be `Uint8Array`s. --> -* `otherBuffer` {Buffer} A `Buffer` or [`Uint8Array`] to compare to +* `otherBuffer` {Buffer} A `Buffer` or [`Uint8Array`] to compare to. * Returns: {boolean} Returns `true` if both `buf` and `otherBuffer` have exactly the same bytes, @@ -1221,12 +1221,12 @@ changes: description: The `encoding` parameter is supported now. --> -* `value` {string|Buffer|integer} The value to fill `buf` with -* `offset` {integer} Where to start filling `buf`. **Default:** `0` +* `value` {string|Buffer|integer} The value to fill `buf` with. +* `offset` {integer} Number of bytes to skip before starting to fill `buf`. **Default:** `0` * `end` {integer} Where to stop filling `buf` (not inclusive). **Default:** [`buf.length`] * `encoding` {string} If `value` is a string, this is its encoding. **Default:** `'utf8'` -* Returns: {Buffer} A reference to `buf` +* Returns: {Buffer} A reference to `buf`. Fills `buf` with the specified `value`. If the `offset` and `end` are not given, the entire `buf` will be filled. This is meant to be a small simplification to @@ -1258,11 +1258,11 @@ console.log(Buffer.allocUnsafe(3).fill('\u0222')); added: v5.3.0 --> -* `value` {string|Buffer|integer} What to search for +* `value` {string|Buffer|integer} What to search for. * `byteOffset` {integer} Where to begin searching in `buf`. **Default:** `0` * `encoding` {string} If `value` is a string, this is its encoding. **Default:** `'utf8'` -* Returns: {boolean} `true` if `value` was found in `buf`, `false` otherwise +* Returns: {boolean} `true` if `value` was found in `buf`, `false` otherwise. Equivalent to [`buf.indexOf() !== -1`][`buf.indexOf()`]. @@ -1307,12 +1307,12 @@ changes: is no longer required. --> -* `value` {string|Buffer|Uint8Array|integer} What to search for +* `value` {string|Buffer|Uint8Array|integer} What to search for. * `byteOffset` {integer} Where to begin searching in `buf`. **Default:** `0` * `encoding` {string} If `value` is a string, this is its encoding. **Default:** `'utf8'` * Returns: {integer} The index of the first occurrence of `value` in `buf` or `-1` - if `buf` does not contain `value` + if `buf` does not contain `value`. If `value` is: @@ -1420,13 +1420,13 @@ changes: description: The `value` can now be a `Uint8Array`. --> -* `value` {string|Buffer|Uint8Array|integer} What to search for +* `value` {string|Buffer|Uint8Array|integer} What to search for. * `byteOffset` {integer} Where to begin searching in `buf`. **Default:** [`buf.length`]` - 1` * `encoding` {string} If `value` is a string, this is its encoding. **Default:** `'utf8'` * Returns: {integer} The index of the last occurrence of `value` in `buf` or `-1` - if `buf` does not contain `value` + if `buf` does not contain `value`. Identical to [`buf.indexOf()`], except `buf` is searched from back to front instead of front to back. @@ -1557,7 +1557,7 @@ The `buf.parent` property is a deprecated alias for `buf.buffer`. added: v0.11.15 --> -* `offset` {integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 8` +* `offset` {integer} Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. * `noAssert` {boolean} Skip `offset` validation? **Default:** `false` * Returns: {number} @@ -1593,7 +1593,7 @@ console.log(buf.readDoubleLE(1, true)); added: v0.11.15 --> -* `offset` {integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 4` +* `offset` {integer} Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 4`. * `noAssert` {boolean} Skip `offset` validation? **Default:** `false` * Returns: {number} @@ -1628,7 +1628,7 @@ console.log(buf.readFloatLE(1, true)); added: v0.5.0 --> -* `offset` {integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 1` +* `offset` {integer} Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 1`. * `noAssert` {boolean} Skip `offset` validation? **Default:** `false` * Returns: {integer} @@ -1660,7 +1660,7 @@ console.log(buf.readInt8(2)); added: v0.5.5 --> -* `offset` {integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 2` +* `offset` {integer} Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 2`. * `noAssert` {boolean} Skip `offset` validation? **Default:** `false` * Returns: {integer} @@ -1694,7 +1694,7 @@ console.log(buf.readInt16LE(1)); added: v0.5.5 --> -* `offset` {integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 4` +* `offset` {integer} Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 4`. * `noAssert` {boolean} Skip `offset` validation? **Default:** `false` * Returns: {integer} @@ -1728,9 +1728,9 @@ console.log(buf.readInt32LE(1)); added: v0.11.15 --> -* `offset` {integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - byteLength` -* `byteLength` {integer} How many bytes to read. Must satisfy: `0 < byteLength <= 6` -* `noAssert` {boolean} Skip `offset` and `byteLength` validation? **Default:** `false` +* `offset` {integer} Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - byteLength`. +* `byteLength` {integer} Number of bytes to read. Must satisfy: `0 < byteLength <= 6`. +* `noAssert` {boolean} Skip `offset` and `byteLength` validation? **Default:** `false`. * Returns: {integer} Reads `byteLength` number of bytes from `buf` at the specified `offset` @@ -1760,7 +1760,7 @@ console.log(buf.readIntBE(1, 6).toString(16)); added: v0.5.0 --> -* `offset` {integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 1` +* `offset` {integer} Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 1`. * `noAssert` {boolean} Skip `offset` validation? **Default:** `false` * Returns: {integer} @@ -1790,7 +1790,7 @@ console.log(buf.readUInt8(2)); added: v0.5.5 --> -* `offset` {integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 2` +* `offset` {integer} Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 2`. * `noAssert` {boolean} Skip `offset` validation? **Default:** `false` * Returns: {integer} @@ -1828,7 +1828,7 @@ console.log(buf.readUInt16LE(2).toString(16)); added: v0.5.5 --> -* `offset` {integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 4` +* `offset` {integer} Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 4`. * `noAssert` {boolean} Skip `offset` validation? **Default:** `false` * Returns: {integer} @@ -1860,8 +1860,8 @@ console.log(buf.readUInt32LE(1).toString(16)); added: v0.11.15 --> -* `offset` {integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - byteLength` -* `byteLength` {integer} How many bytes to read. Must satisfy: `0 < byteLength <= 6` +* `offset` {integer} Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - byteLength`. +* `byteLength` {integer} Number of bytes to read. Must satisfy: `0 < byteLength <= 6`. * `noAssert` {boolean} Skip `offset` and `byteLength` validation? **Default:** `false` * Returns: {integer} @@ -1963,7 +1963,7 @@ console.log(buf.slice(-5, -2).toString()); added: v5.10.0 --> -* Returns: {Buffer} A reference to `buf` +* Returns: {Buffer} A reference to `buf`. Interprets `buf` as an array of unsigned 16-bit integers and swaps the byte-order *in-place*. Throws a `RangeError` if [`buf.length`] is not a multiple of 2. @@ -1993,7 +1993,7 @@ buf2.swap16(); added: v5.10.0 --> -* Returns: {Buffer} A reference to `buf` +* Returns: {Buffer} A reference to `buf`. Interprets `buf` as an array of unsigned 32-bit integers and swaps the byte-order *in-place*. Throws a `RangeError` if [`buf.length`] is not a multiple of 4. @@ -2023,7 +2023,7 @@ buf2.swap32(); added: v6.3.0 --> -* Returns: {Buffer} A reference to `buf` +* Returns: {Buffer} A reference to `buf`. Interprets `buf` as an array of 64-bit numbers and swaps the byte-order *in-place*. Throws a `RangeError` if [`buf.length`] is not a multiple of 8. @@ -2169,11 +2169,11 @@ for (const value of buf) { added: v0.1.90 --> -* `string` {string} String to be written to `buf` -* `offset` {integer} Where to start writing `string`. **Default:** `0` -* `length` {integer} How many bytes to write. **Default:** `buf.length - offset` +* `string` {string} String to be written to `buf`. +* `offset` {integer} Number of bytes to skip before starting to write `string`. **Default:** `0` +* `length` {integer} Number of bytes to write. **Default:** `buf.length - offset` * `encoding` {string} The character encoding of `string`. **Default:** `'utf8'` -* Returns: {integer} Number of bytes written +* Returns: {integer} Number of bytes written. Writes `string` to `buf` at `offset` according to the character encoding in `encoding`. The `length` parameter is the number of bytes to write. If `buf` did not contain @@ -2197,10 +2197,10 @@ console.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`); added: v0.11.15 --> -* `value` {number} Number to be written to `buf` -* `offset` {integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 8` +* `value` {number} Number to be written to `buf`. +* `offset` {integer} Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. * `noAssert` {boolean} Skip `value` and `offset` validation? **Default:** `false` -* Returns: {integer} `offset` plus the number of bytes written +* Returns: {integer} `offset` plus the number of bytes written. Writes `value` to `buf` at the specified `offset` with specified endian format (`writeDoubleBE()` writes big endian, `writeDoubleLE()` writes little @@ -2232,10 +2232,10 @@ console.log(buf); added: v0.11.15 --> -* `value` {number} Number to be written to `buf` -* `offset` {integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 4` +* `value` {number} Number to be written to `buf`. +* `offset` {integer} Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 4`. * `noAssert` {boolean} Skip `value` and `offset` validation? **Default:** `false` -* Returns: {integer} `offset` plus the number of bytes written +* Returns: {integer} `offset` plus the number of bytes written. Writes `value` to `buf` at the specified `offset` with specified endian format (`writeFloatBE()` writes big endian, `writeFloatLE()` writes little @@ -2266,10 +2266,10 @@ console.log(buf); added: v0.5.0 --> -* `value` {integer} Number to be written to `buf` -* `offset` {integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 1` +* `value` {integer} Number to be written to `buf`. +* `offset` {integer} Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 1`. * `noAssert` {boolean} Skip `value` and `offset` validation? **Default:** `false` -* Returns: {integer} `offset` plus the number of bytes written +* Returns: {integer} `offset` plus the number of bytes written. Writes `value` to `buf` at the specified `offset`. `value` *should* be a valid signed 8-bit integer. Behavior is undefined when `value` is anything other than @@ -2298,10 +2298,10 @@ console.log(buf); added: v0.5.5 --> -* `value` {integer} Number to be written to `buf` -* `offset` {integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 2` +* `value` {integer} Number to be written to `buf`. +* `offset` {integer} Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 2`. * `noAssert` {boolean} Skip `value` and `offset` validation? **Default:** `false` -* Returns: {integer} `offset` plus the number of bytes written +* Returns: {integer} `offset` plus the number of bytes written. Writes `value` to `buf` at the specified `offset` with specified endian format (`writeInt16BE()` writes big endian, `writeInt16LE()` writes little @@ -2331,10 +2331,10 @@ console.log(buf); added: v0.5.5 --> -* `value` {integer} Number to be written to `buf` -* `offset` {integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 4` +* `value` {integer} Number to be written to `buf`. +* `offset` {integer} Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 4`. * `noAssert` {boolean} Skip `value` and `offset` validation? **Default:** `false` -* Returns: {integer} `offset` plus the number of bytes written +* Returns: {integer} `offset` plus the number of bytes written. Writes `value` to `buf` at the specified `offset` with specified endian format (`writeInt32BE()` writes big endian, `writeInt32LE()` writes little @@ -2364,12 +2364,12 @@ console.log(buf); added: v0.11.15 --> -* `value` {integer} Number to be written to `buf` -* `offset` {integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - byteLength` -* `byteLength` {integer} How many bytes to write. Must satisfy: `0 < byteLength <= 6` +* `value` {integer} Number to be written to `buf`. +* `offset` {integer} Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - byteLength`. +* `byteLength` {integer} Number of bytes to write. Must satisfy: `0 < byteLength <= 6`. * `noAssert` {boolean} Skip `value`, `offset`, and `byteLength` validation? **Default:** `false` -* Returns: {integer} `offset` plus the number of bytes written +* Returns: {integer} `offset` plus the number of bytes written. Writes `byteLength` bytes of `value` to `buf` at the specified `offset`. Supports up to 48 bits of accuracy. Behavior is undefined when `value` is @@ -2399,10 +2399,10 @@ console.log(buf); added: v0.5.0 --> -* `value` {integer} Number to be written to `buf` -* `offset` {integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 1` +* `value` {integer} Number to be written to `buf`. +* `offset` {integer} Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 1`. * `noAssert` {boolean} Skip `value` and `offset` validation? **Default:** `false` -* Returns: {integer} `offset` plus the number of bytes written +* Returns: {integer} `offset` plus the number of bytes written. Writes `value` to `buf` at the specified `offset`. `value` *should* be a valid unsigned 8-bit integer. Behavior is undefined when `value` is anything @@ -2431,10 +2431,10 @@ console.log(buf); added: v0.5.5 --> -* `value` {integer} Number to be written to `buf` -* `offset` {integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 2` +* `value` {integer} Number to be written to `buf`. +* `offset` {integer} Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 2`. * `noAssert` {boolean} Skip `value` and `offset` validation? **Default:** `false` -* Returns: {integer} `offset` plus the number of bytes written +* Returns: {integer} `offset` plus the number of bytes written. Writes `value` to `buf` at the specified `offset` with specified endian format (`writeUInt16BE()` writes big endian, `writeUInt16LE()` writes little @@ -2468,10 +2468,10 @@ console.log(buf); added: v0.5.5 --> -* `value` {integer} Number to be written to `buf` -* `offset` {integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 4` +* `value` {integer} Number to be written to `buf`. +* `offset` {integer} Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 4`. * `noAssert` {boolean} Skip `value` and `offset` validation? **Default:** `false` -* Returns: {integer} `offset` plus the number of bytes written +* Returns: {integer} `offset` plus the number of bytes written. Writes `value` to `buf` at the specified `offset` with specified endian format (`writeUInt32BE()` writes big endian, `writeUInt32LE()` writes little @@ -2503,12 +2503,12 @@ console.log(buf); added: v0.5.5 --> -* `value` {integer} Number to be written to `buf` -* `offset` {integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - byteLength` -* `byteLength` {integer} How many bytes to write. Must satisfy: `0 < byteLength <= 6` +* `value` {integer} Number to be written to `buf`. +* `offset` {integer} Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - byteLength`. +* `byteLength` {integer} Number of bytes to write. Must satisfy: `0 < byteLength <= 6`. * `noAssert` {boolean} Skip `value`, `offset`, and `byteLength` validation? **Default:** `false` -* Returns: {integer} `offset` plus the number of bytes written +* Returns: {integer} `offset` plus the number of bytes written. Writes `byteLength` bytes of `value` to `buf` at the specified `offset`. Supports up to 48 bits of accuracy. Behavior is undefined when `value` is @@ -2552,7 +2552,7 @@ Note that this is a property on the `buffer` module returned by added: v3.0.0 --> -* {integer} The largest size allowed for a single `Buffer` instance +* {integer} The largest size allowed for a single `Buffer` instance. An alias for [`buffer.constants.MAX_LENGTH`][] @@ -2568,9 +2568,9 @@ changes: description: The `source` parameter can now be a `Uint8Array`. --> -* `source` {Buffer|Uint8Array} A `Buffer` or `Uint8Array` instance -* `fromEnc` {string} The current encoding -* `toEnc` {string} To target encoding +* `source` {Buffer|Uint8Array} A `Buffer` or `Uint8Array` instance. +* `fromEnc` {string} The current encoding. +* `toEnc` {string} To target encoding. Re-encodes the given `Buffer` or `Uint8Array` instance from one character encoding to another. Returns a new `Buffer` instance. @@ -2642,7 +2642,7 @@ deprecated: v6.0.0 > Stability: 0 - Deprecated: Use [`Buffer.allocUnsafeSlow()`] instead. -* `size` {integer} The desired length of the new `SlowBuffer` +* `size` {integer} The desired length of the new `SlowBuffer`. Allocates a new `Buffer` of `size` bytes. If the `size` is larger than [`buffer.constants.MAX_LENGTH`] or smaller than 0, a [`RangeError`] will be @@ -2681,7 +2681,7 @@ Note that `buffer.constants` is a property on the `buffer` module returned by added: 8.2.0 --> -* {integer} The largest size allowed for a single `Buffer` instance +* {integer} The largest size allowed for a single `Buffer` instance. On 32-bit architectures, this value is `(2^30)-1` (~1GB). On 64-bit architectures, this value is `(2^31)-1` (~2GB). @@ -2693,7 +2693,7 @@ This value is also available as [`buffer.kMaxLength`][]. added: 8.2.0 --> -* {integer} The largest length allowed for a single `string` instance +* {integer} The largest length allowed for a single `string` instance. Represents the largest `length` that a `string` primitive can have, counted in UTF-16 code units. |