doc: Buffer.prototype.byteLength is undocumentedΒ #34946
Copy link
Copy link
Closed
Labels
bufferIssues and PRs related to the buffer subsystem.Issues and PRs related to the buffer subsystem.docIssues and PRs related to Node.js documentation.Issues and PRs related to Node.js documentation.
Description
π API Reference Docs Problem
- Subsystem: buffer
Location
Affected URL(s):
Description
Buffer instances have a undocumented .byteLength property. We should document it. Docs only exist for the static method Buffer.byteLength but not for Buffer.prototype.byteLength.
> Buffer.from("π").byteLength
4- I would like to work on this issue and submit a pull request.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bufferIssues and PRs related to the buffer subsystem.Issues and PRs related to the buffer subsystem.docIssues and PRs related to Node.js documentation.Issues and PRs related to Node.js documentation.
Activity
mscdex commentedon Aug 27, 2020
I believe that's because it's inherited from
TypedArray.PoojaDurgad commentedon Aug 27, 2020
I would like to work on this issue and submit a pull request.
PoojaDurgad commentedon Aug 27, 2020
@silverwind Can I document property under buffer class
silverwind commentedon Aug 27, 2020
@mscdex isn't it coming from ArrayBuffer#byteLength?
@PoojaDurgad Let's first get clearance whether we document inherited properties or not. Once that is decided, I'd suggest adding it below the buf.buffer prototype method, possibly with just a link to MDN.
mscdex commentedon Aug 27, 2020
@silverwind Not necessarily. If the
Buffer/Uint8Arrayis a subset of the backingArrayBuffer, then the subset length will be returned and not theArrayBufferlength.silverwind commentedon Aug 27, 2020
Removing
Good first issuefor now as it's not as trivial as I thought it would be.Xstoudi commentedon Jan 7, 2026
Not really fan of documenting the
TypedArrayproperties as it would probably open the door to document everyTypedArraymethod.Would you mind if completed this quote from the Buffer doc tho?
silverwind commentedon Jan 12, 2026
I think we could write "All TypedArray properties are available on Buffers." to make it clear that not only methods are available, but also instance properties like this one.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength
silverwind commentedon Jan 12, 2026
#61355
doc: clarify TypedArray properties on Buffer
doc: clarify TypedArray properties on Buffer
doc: clarify TypedArray properties on Buffer
doc: clarify TypedArray properties on Buffer
doc: clarify TypedArray properties on Buffer
doc: clarify TypedArray properties on Buffer
doc: clarify TypedArray properties on Buffer
doc: clarify TypedArray properties on Buffer
doc: clarify TypedArray properties on Buffer