chardet

  • Version 2.1.0
  • Published
  • 162 kB
  • No dependencies
  • MIT license

Install

npm i chardet
yarn add chardet
pnpm add chardet

Overview

Character encoding detector

Index

Variables

variable _default

const _default: {
analyse: (buffer: Uint8Array) => AnalyseResult;
detect: (buffer: Uint8Array) => string | null;
detectFileSync: (filepath: string, opts?: Options) => DetectResult;
detectFile: (filepath: string, opts?: Options) => Promise<DetectResult>;
};

    Functions

    function analyse

    analyse: (buffer: Uint8Array) => AnalyseResult;

      function detect

      detect: (buffer: Uint8Array) => string | null;

        function detectFile

        detectFile: (filepath: string, opts?: Options) => Promise<DetectResult>;

          function detectFileSync

          detectFileSync: (filepath: string, opts?: Options) => DetectResult;

            Interfaces

            interface Match

            interface Match {}

              property confidence

              confidence: number;

                property lang

                lang?: string;

                  property name

                  name: EncodingName;

                    Type Aliases

                    type AnalyseResult

                    type AnalyseResult = Match[];

                      type DetectResult

                      type DetectResult = string | null;

                        type EncodingName

                        type EncodingName =
                        | 'ASCII'
                        | 'Big5'
                        | 'EUC-JP'
                        | 'EUC-KR'
                        | 'GB18030'
                        | 'ISO_2022'
                        | 'ISO-2022-CN'
                        | 'ISO-2022-JP'
                        | 'ISO-2022-KR'
                        | 'ISO-8859-1'
                        | 'ISO-8859-2'
                        | 'ISO-8859-5'
                        | 'ISO-8859-6'
                        | 'ISO-8859-7'
                        | 'ISO-8859-8'
                        | 'ISO-8859-9'
                        | 'ISO-8859-9'
                        | 'KOI8-R'
                        | 'mbcs'
                        | 'sbcs'
                        | 'Shift_JIS'
                        | 'UTF-16BE'
                        | 'UTF-16LE'
                        | 'UTF-32'
                        | 'UTF-32BE'
                        | 'UTF-32LE'
                        | 'UTF-8'
                        | 'windows-1250'
                        | 'windows-1251'
                        | 'windows-1252'
                        | 'windows-1253'
                        | 'windows-1254'
                        | 'windows-1254'
                        | 'windows-1255'
                        | 'windows-1256';

                          type Options

                          type Options = Partial<FullOptions>;

                            Package Files (2)

                            Dependencies (0)

                            No dependencies.

                            Dev Dependencies (8)

                            Peer Dependencies (0)

                            No peer dependencies.

                            Badge

                            To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                            You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/chardet.

                            • Markdown
                              [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/chardet)
                            • HTML
                              <a href="https://www.jsdocs.io/package/chardet"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>