From 3a25717fce5d8bea1146aa0726576c97ba20c0ab Mon Sep 17 00:00:00 2001 From: jaexxin Date: Tue, 30 Jul 2024 14:27:28 +0900 Subject: [PATCH 1/5] doc: add documentation for blob.bytes() method Add documentation for blob.bytes() method doc: add documentation for blob.bytes() method --- doc/api/buffer.md | 11 +++++++++++ 1 file changed, 11 insertions(+) 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()` The `blob.bytes()` method returns the byte of the `Blob` object as a `Promise`. From 6574a6a3df8ff7dcf4c2cb16af88b014c84e2b64 Mon Sep 17 00:00:00 2001 From: jaexxin Date: Tue, 30 Jul 2024 23:43:03 +0900 Subject: [PATCH 3/5] doc: add documentation for blob.bytes() method --- doc/api/buffer.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/api/buffer.md b/doc/api/buffer.md index fd65f8379ee324..15aa48be74646e 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -539,6 +539,7 @@ 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.size` -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()` From 418822333498d5223f9f1071beb06b32cdb0904f Mon Sep 17 00:00:00 2001 From: jaexxin Date: Wed, 31 Jul 2024 16:09:13 +0900 Subject: [PATCH 5/5] doc: add documentation for blob.bytes() method --- doc/api/buffer.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/doc/api/buffer.md b/doc/api/buffer.md index db8c2ff062ce9a..6c587f58d7c4a4 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -517,6 +517,7 @@ the `Blob` data. @@ -529,7 +530,6 @@ blob.bytes().then((bytes) => { }); ``` - ### `blob.size`