Skip to content

Commit 2ca86b3

Browse files
authored
Docs: Remove BYOB stream requirement warning (#790)
1 parent 4d7393a commit 2ca86b3

1 file changed

Lines changed: 0 additions & 15 deletions

File tree

readme.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -206,21 +206,6 @@ console.log(await fileTypeFromBlob(blob));
206206
//=> {ext: 'txt', mime: 'text/plain'}
207207
```
208208

209-
> [!WARNING]
210-
> This method depends on [ReadableStreamBYOBReader](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader) which **requires Node.js ≥ 20**
211-
> and [may not be available in all modern browsers](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader#browser_compatibility).
212-
213-
To work around this limitation, you can use an alternative approach to read and process the `Blob` without relying on streaming:
214-
215-
```js
216-
import {fileTypeFromBuffer} from 'file-type';
217-
218-
async function readFromBlobWithoutStreaming(blob) {
219-
const buffer = await blob.arrayBuffer();
220-
return fileTypeFromBuffer(buffer);
221-
}
222-
```
223-
224209
#### blob
225210

226211
Type: [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob)

0 commit comments

Comments
 (0)