diff --git a/doc/api/buffer.md b/doc/api/buffer.md index c72590cb71538c..6c587f58d7c4a4 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -513,6 +513,23 @@ added: Returns a promise that fulfills with an {ArrayBuffer} containing a copy of the `Blob` data. +#### `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.size`