Skip to content

Commit

Permalink
doc: add documentation for blob.bytes() method
Browse files Browse the repository at this point in the history
Add documentation for blob.bytes() method

doc: add documentation for blob.bytes() method
  • Loading branch information
jmsb02 committed Jul 30, 2024
1 parent 3a5b542 commit 3a25717
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions doc/api/buffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,17 @@ added:
Creates and returns a new `Blob` containing a subset of this `Blob` objects
data. The original `Blob` is not altered.

#### `blob.bytes()`

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

```js
const blob = new Blob(['hello']);
blob.bytes().then((bytes) => {
console.log(bytes); // Outputs: Uint8Array(5) [ 104, 101, 108, 108, 111 ]
});
```

### `blob.stream()`

<!-- YAML
Expand Down

0 comments on commit 3a25717

Please sign in to comment.