Skip to content

Commit

Permalink
Document stream() detection limitation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Borewit committed Feb 1, 2021
1 parent 2cc0869 commit 3e67451
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,10 @@ Detect the file type of a readable stream.

Returns a `Promise` which resolves to the original readable stream argument, but with an added `fileType` property, which is an object like the one returned from `FileType.fromFile()`.

TVery handy to put in between a stream, but it comes for a price.
Internally `stream()` builds up a buffer of 4100 bytes, used as a sample, to determine the file type.
Having only a limited sample available has an impact on the file detection resolution.

*Note:* This method is only available using Node.js.

#### readableStream
Expand Down

0 comments on commit 3e67451

Please sign in to comment.