diff --git a/readme.md b/readme.md index 7f72750b..2146aa4a 100644 --- a/readme.md +++ b/readme.md @@ -282,13 +282,11 @@ A file source implementing the [tokenizer interface](https://github.com/Borewit/ Detect the file type of a readable stream. -If `sampleSize` is not provided, a backward compatible sample size of 4100 bytes is used. +If `sampleSize` is not provided, a backward-compatible sample size of 4100 bytes is used. 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()`. -Very handy to put in between a stream, but it comes with a price. -Internally `stream()` builds up a buffer of `sampleSize` bytes, used as a sample, to determine the file type. -The sample size impacts the file detection resolution. A smaller sample size will result in lower probability of the best file type detection. +Very handy to put in between a stream, but it comes with a price. Internally `stream()` builds up a buffer of `sampleSize` bytes, used as a sample, to determine the file type. The sample size impacts the file detection resolution. A smaller sample size will result in lower probability of the best file type detection. *Note:* This method is only available using Node.js.