From bab1db0a77ea8430daadb06d7411d3573b7a3595 Mon Sep 17 00:00:00 2001 From: Eliott Vincent Date: Fri, 7 Oct 2022 10:23:13 +0200 Subject: [PATCH] Bump README --- README.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7da2139..6563a85 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ import chardet from 'chardet'; chardet.analyse(Buffer.from('hello there!')); ``` -Returned value is an array of objects sorted by confidence value in decending order +Returned value is an array of objects sorted by confidence value in descending order ```javascript [ @@ -48,8 +48,8 @@ Returned value is an array of objects sorted by confidence value in decending or ## Working with large data sets -Sometimes, when data set is huge and you want to optimize performace (with a tradeoff of less accuracy), -you can sample only first N bytes of the buffer: +Sometimes, when data set is huge and you want to optimize performance (with a tradeoff of less accuracy), +you can sample only the first N bytes of the buffer: ```javascript chardet @@ -57,6 +57,14 @@ chardet .then(encoding => console.log(encoding)); ``` +You can also specify where to begin reading from in the buffer: + +```javascript +chardet + .detectFile('/path/to/file', { sampleSize: 32, offset: 128 }) + .then(encoding => console.log(encoding)); +``` + ## Supported Encodings: - UTF-8