From 8f2886d5fa7281ceaca0e15aedc604bdbb995976 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Mon, 12 Jul 2021 20:56:36 +0200 Subject: [PATCH] Update readme.md --- readme.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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.