| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -513,6 +513,23 @@ added: | |||
| 513 | 513 | Returns a promise that fulfills with an {ArrayBuffer} containing a copy of | |
| 514 | 514 | the `Blob` data. | |
| 515 | 515 | ||
| 516 | + #### `blob.bytes()` | ||
| 517 | + | ||
| 518 | + <!-- YAML | ||
| 519 | + added: | ||
| 520 | + - v22.3.0 | ||
| 521 | + - v20.16.0 | ||
| 522 | + --> | ||
| 523 | + | ||
| 524 | + The `blob.bytes()` method returns the byte of the `Blob` object as a `Promise<Uint8Array>`. | ||
| 525 | + | ||
| 526 | + ```js | ||
| 527 | + const blob = new Blob(['hello']); | ||
| 528 | + blob.bytes().then((bytes) => { | ||
| 529 | + console.log(bytes); // Outputs: Uint8Array(5) [ 104, 101, 108, 108, 111 ] | ||
| 530 | + }); | ||
| 531 | + ``` | ||
| 532 | + | ||
| 516 | 533 | ### `blob.size` | |
| 517 | 534 | ||
| 518 | 535 | <!-- YAML | |
| Back | FazBrowse Home | New Git URL |
0 commit comments