Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 12 additions & 0 deletions doc/api/buffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,18 @@ added:
Returns a promise that fulfills with an {ArrayBuffer} containing a copy of
the `Blob` data.

### `blob.bytes()`

<!-- YAML
added:
- v20.16.0
-->

* Returns: {Promise}

Returns a promise that fulfills with a {Uint8Array} containing a copy of the
`Blob` data.

### `blob.size`

<!-- YAML
Expand Down
4 changes: 4 additions & 0 deletions lib/internal/blob.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,10 @@ class Blob {
return dec.decode(await this.arrayBuffer());
}

/**
* @returns {Promise<Uint8Array>}
*/

bytes() {
if (!isBlob(this))
throw new ERR_INVALID_THIS('Blob');
Expand Down