Permalink
Browse files

doc: document buffer.buffer property

Buffer objects expose the underlying `Uint8Array`'s `buffer` property
by default. This patch formally documents it.

PR-URL: #8332
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
  • Loading branch information...
thefourtheye committed Jan 10, 2017
1 parent 16e3cf6 commit 03d440e3ced202221e6b95b718d35941af25b16f
Showing with 13 additions and 0 deletions.
  1. +13 −0 doc/api/buffer.md
View
@@ -879,6 +879,19 @@ for (let i = 0; i < str.length ; i++) {
console.log(buf.toString('ascii'));
```
### buf.buffer
The `buffer` property references the underlying `ArrayBuffer` object based on
which this Buffer object is created.
```js
const arrayBuffer = new ArrayBuffer(16);
const buffer = Buffer.from(arrayBuffer);
console.log(buffer.buffer === arrayBuffer);
// Prints: true
```
### buf.compare(target[, targetStart[, targetEnd[, sourceStart[, sourceEnd]]]])
<!-- YAML
added: v0.11.13

0 comments on commit 03d440e

Please sign in to comment.