Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

chardet

Package Overview
Dependencies
0
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.8.0 to 1.0.0

.prettierrc.json

61

package.json
{
"name": "chardet",
"version": "0.8.0",
"version": "1.0.0",
"homepage": "https://github.com/runk/node-chardet",
"description": "Character detector",
"keywords": [
"encoding",
"character",
"utf8",
"detector",
"chardet",
"icu"
],
"author": "Dmitry Shirokov <deadrunk@gmail.com>",
"contributors": [
"@spikying",
"@wtgtybhertgeghgtwtg",
"@suisho",
"@seangarner",
"@zevanty"
],
"devDependencies": {
"mocha": "^6.1.4",
"semantic-release": "^15.13.18"
},
"license": "MIT",
"repository": {

@@ -35,6 +16,13 @@ "type": "git",

"scripts": {
"test": "mocha -R spec --recursive --bail",
"build": "rm -rf lib/* && tsc",
"lint": "tslint -p tsconfig.json -c tslint.json",
"lint:types": "tsc --noEmit",
"format": "prettier --write ./src/**/*.ts",
"format:check": "prettier --list-different ./src/**/*.ts",
"test": "jest",
"prepublish": "npm run build",
"semantic-release": "semantic-release"
},
"main": "index.js",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"engine": {

@@ -47,3 +35,28 @@ "node": ">=4"

},
"license": "MIT"
"devDependencies": {
"@types/jest": "^25.1.4",
"@types/node": "^13.9.5",
"jest": "^25.2.4",
"prettier": "^2.0.2",
"semantic-release": "^15.14.0",
"ts-jest": "^25.2.1",
"tslint": "^6.1.0",
"typescript": "^3.8.3"
},
"keywords": [
"encoding",
"character",
"utf8",
"detector",
"chardet",
"icu"
],
"author": "Dmitry Shirokov <deadrunk@gmail.com>",
"contributors": [
"@spikying",
"@wtgtybhertgeghgtwtg",
"@suisho",
"@seangarner",
"@zevanty"
]
}

@@ -0,5 +1,3 @@

# chardet [![Build Status](https://travis-ci.org/runk/node-chardet.png)](https://travis-ci.org/runk/node-chardet)
chardet [![Build Status](https://travis-ci.org/runk/node-chardet.png)](https://travis-ci.org/runk/node-chardet)
=====
Chardet is a character detection module for NodeJS written in pure Javascript.

@@ -18,7 +16,9 @@ Module is based on ICU project http://site.icu-project.org/, which uses character

To return the encoding with the highest confidence:
```javascript
var chardet = require('chardet');
const chardet = require('chardet');
chardet.detect(Buffer.from('hello there!'));
// or
chardet.detectFile('/path/to/file', function(err, encoding) {});
chardet.detectFile('/path/to/file').then(encoding => console.log(encoding));
// or

@@ -28,14 +28,16 @@ chardet.detectFileSync('/path/to/file');

To return the full list of possible encodings use `analyse` method.
To return the full list of possible encodings:
```javascript
var chardet = require('chardet');
chardet.detectAll(Buffer.from('hello there!'));
// or
chardet.detectFileAll('/path/to/file', function(err, encoding) {});
// or
chardet.detectFileAllSync('/path/to/file');
const chardet = require('chardet');
chardet.analyse(Buffer.from('hello there!'));
```
//Returned value is an array of objects sorted by confidence value in decending order
//e.g. [{ confidence: 90, name: 'UTF-8'}, {confidence: 20, name: 'windows-1252', lang: 'fr'}]
Returned value is an array of objects sorted by confidence value in decending order
```javascript
[
{ confidence: 90, name: 'UTF-8' },
{ confidence: 20, name: 'windows-1252', lang: 'fr' }
];
```

@@ -49,3 +51,5 @@

```javascript
chardet.detectFile('/path/to/file', { sampleSize: 32 }, function(err, encoding) {});
chardet
.detectFile('/path/to/file', { sampleSize: 32 })
.then(encoding => console.log(encoding));
```

@@ -55,31 +59,35 @@

* UTF-8
* UTF-16 LE
* UTF-16 BE
* UTF-32 LE
* UTF-32 BE
* ISO-2022-JP
* ISO-2022-KR
* ISO-2022-CN
* Shift-JIS
* Big5
* EUC-JP
* EUC-KR
* GB18030
* ISO-8859-1
* ISO-8859-2
* ISO-8859-5
* ISO-8859-6
* ISO-8859-7
* ISO-8859-8
* ISO-8859-9
* windows-1250
* windows-1251
* windows-1252
* windows-1253
* windows-1254
* windows-1255
* windows-1256
* KOI8-R
- UTF-8
- UTF-16 LE
- UTF-16 BE
- UTF-32 LE
- UTF-32 BE
- ISO-2022-JP
- ISO-2022-KR
- ISO-2022-CN
- Shift-JIS
- Big5
- EUC-JP
- EUC-KR
- GB18030
- ISO-8859-1
- ISO-8859-2
- ISO-8859-5
- ISO-8859-6
- ISO-8859-7
- ISO-8859-8
- ISO-8859-9
- windows-1250
- windows-1251
- windows-1252
- windows-1253
- windows-1254
- windows-1255
- windows-1256
- KOI8-R
Currently only these encodings are supported, more will be added soon.
Currently only these encodings are supported.
## Typescript?
Yes. Type definitions are included.

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc