npm / chardet
chardet
What changed in chardet 1 to 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
1 breaking1 security4 deprecations3 new APIs and options1 behavior and defaults1 tooling1 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initchardet 25 changes
Breaking changes 1
Inputs are now restricted to Array instances with numeric values <= 255, including shapes like Buffer or Uint8Array; strings and other inputs are not accepted.
Security 1
Buffer allocation was made safer.
New APIs and options 2
Adds detection support for windows-1257.
Adds detection support for windows-1258.
Fixes and other changes 1
Sample size handling was fixed.
chardet 17 changes
Deprecations 4
Callbacks are deprecated in favour of promises.
detectAll is deprecated; use analyse instead.
detectFileAll is deprecated; use analyse instead.
detectFileAllSync is deprecated; use analyse instead.
New APIs and options 1
Modules support is included.
Behavior and default changes 1
The fs module is lazy loaded to enable usage in a browser.
Tooling 1
TypeScript typings are now included as part of the distribution.