diff --git a/doc/api/buffer.md b/doc/api/buffer.md index c72590cb71538c..30d272c5ced5ae 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -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`. + +```js +const blob = new Blob(['hello']); +blob.bytes().then((bytes) => { + console.log(bytes); // Outputs: Uint8Array(5) [ 104, 101, 108, 108, 111 ] +}); +``` + ### `blob.stream()`