Gathering detailed insights and metrics for jschardet
Gathering detailed insights and metrics for jschardet
Gathering detailed insights and metrics for jschardet
Gathering detailed insights and metrics for jschardet
iconv-jschardet
Convert/auto-detection Character encodings in JavaScript ( iconv-lite, jschardet )
jschardet-eastasia
East Asia character(Chinese,Janpanse,Korean) encoding auto-detection in JavaScript (port of python's chardet)
jschardet-french
Character encoding auto-detection in JavaScript (port of python's chardet)
jschardet-cli
A cli wrapper for jschardet.
Character encoding auto-detection in JavaScript (port of python's chardet)
npm install jschardet
Typescript
Module System
Min. Node Version
Node Version
NPM Version
99.6
Supply Chain
99.6
Quality
77.7
Maintenance
100
Vulnerability
80.9
License
JavaScript (98.58%)
Shell (0.72%)
CSS (0.58%)
HTML (0.12%)
Total Downloads
112,783,610
Last Day
67,071
Last Week
415,237
Last Month
1,627,717
Last Year
17,451,533
LGPL-2.1 License
729 Stars
158 Commits
97 Forks
15 Watchers
2 Branches
15 Contributors
Updated on May 03, 2025
Minified
Minified + Gzipped
Latest Version
3.1.4
Package Id
jschardet@3.1.4
Unpacked Size
1.26 MB
Size
435.32 kB
File Count
57
NPM Version
10.8.2
Node Version
20.17.0
Published on
Sep 30, 2024
Cumulative downloads
Total Downloads
Last Day
-0.8%
67,071
Compared to previous day
Last Week
8.1%
415,237
Compared to previous week
Last Month
12%
1,627,717
Compared to previous month
Last Year
-6.8%
17,451,533
Compared to previous year
3
Port of python's chardet (https://github.com/chardet/chardet).
LGPL
npm install jschardet
var jschardet = require("jschardet")
// "àíàçã" in UTF-8
jschardet.detect("\xc3\xa0\xc3\xad\xc3\xa0\xc3\xa7\xc3\xa3")
// { encoding: "UTF-8", confidence: 0.9690625 }
// "次常用國字標準字體表" in Big5
jschardet.detect("\xa6\xb8\xb1\x60\xa5\xce\xb0\xea\xa6\x72\xbc\xd0\xb7\xc7\xa6\x72\xc5\xe9\xaa\xed")
// { encoding: "Big5", confidence: 0.99 }
// Martin Kühl
// jschardet.detectAll("\x3c\x73\x74\x72\x69\x6e\x67\x3e\x4d\x61\x72\x74\x69\x6e\x20\x4b\xfc\x68\x6c\x3c\x2f\x73\x74\x72\x69\x6e\x67\x3e")
// [
// {encoding: "windows-1252", confidence: 0.95},
// {encoding: "ISO-8859-2", confidence: 0.8796300205763055},
// {encoding: "SHIFT_JIS", confidence: 0.01}
// ]
Copy and include jschardet.min.js in your web page.
This library is also available in cdnjs at https://cdnjs.cloudflare.com/ajax/libs/jschardet/1.4.1/jschardet.min.js
1// See all information related to the confidence levels of each encoding. 2// This is useful to see why you're not getting the expected encoding. 3jschardet.enableDebug(); 4 5// Default minimum accepted confidence level is 0.20 but sometimes this is not 6// enough, specially when dealing with files mostly with numbers. 7// To change this to 0 to always get something or any other value that can 8// work for you. 9jschardet.detect(str, { minimumThreshold: 0 }); 10 11// Lock down which encodings to detect, can be useful in situations jschardet 12// is giving a higher probability to encodings that you never use. 13jschardet.detect(str, { detectEncodings: ["UTF-8", "windows-1252"] });
I haven't been able to create tests to correctly detect:
Use npm run dist
to update the distribution files. They're available at https://github.com/aadsm/jschardet/tree/master/dist.
Ported from python to JavaScript by António Afonso (https://github.com/aadsm/jschardet)
Transformed into an npm package by Markus Ast (https://github.com/brainafk)
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 2
Details
Reason
Found 3/26 approved changesets -- score normalized to 1
Reason
9 existing vulnerabilities detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-05-19
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More