Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
doc: document buffer.buffer property
Buffer objects expose the underlying `Uint8Array`'s `buffer` property
by default. This patch formally documents it.
  • Loading branch information
thefourtheye committed Jan 10, 2017
commit 930d1d7ad090bbbf99ba8cbfc9befd23baa92816
13 changes: 13 additions & 0 deletions doc/api/buffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,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
Expand Down