From 17f788b73fc500d8fb7fcb0ab204cae92b4b9382 Mon Sep 17 00:00:00 2001 From: Dmitry Shirokov Date: Mon, 16 Oct 2017 11:46:01 +1100 Subject: [PATCH] Update readme --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 496f518..7ca84e3 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,15 @@ chardet.detectFile('/path/to/file', function(err, encoding) {}); chardet.detectFileSync('/path/to/file'); ``` +## Working with large data sets + +Sometimes, when data set is huge and you want to optimize performace (in tradeoff of less accuracy), +you can sample only first N bytes of the buffer: + +```javascript +chardet.detectFile('/path/to/file', { sampleSize: 32 }, function(err, encoding) {}); +``` + ## Supported Encodings: * UTF-8