Skip to content

Commit 67c5e51

Browse files
committed
doc: add documentation for blob.bytes() method
1 parent 1cecc42 commit 67c5e51

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

doc/api/buffer.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -540,12 +540,14 @@ data. The original `Blob` is not altered.
540540

541541
#### `blob.bytes()`
542542

543-
The `blob.bytes()` method returns the byte of the `Blob` object as a `Buffer`.
543+
The `blob.bytes()` method returns the byte of the `Blob` object as a `Promise<Uint8Array>`.
544544

545545
```js
546546
const blob = new Blob(['hello']);
547-
console.log(blob.bytes()); // Outputs: <Buffer 68 65 6c 6c 6f>
548-
547+
blob.bytes().then((bytes) => {
548+
console.log(bytes); // Outputs: Uint8Array(5) [ 104, 101, 108, 108, 111 ]
549+
});
550+
```
549551

550552
### `blob.stream()`
551553

0 commit comments

Comments
 (0)