• Version 2.0.2
  • Published
  • 5.62 kB
  • 1 dependency
  • MIT license


npm i @types/html-encoding-sniffer
yarn add @types/html-encoding-sniffer
pnpm add @types/html-encoding-sniffer


TypeScript definitions for html-encoding-sniffer



function sniffHTMLEncoding

sniffHTMLEncoding: (
buffer: Buffer,
options?: sniffHTMLEncoding.Options
) => string;
  • Parameter buffer

    The NodeJS buffer containing the (X)HTML source text.

    The canonical [encoding name](https://encoding.spec.whatwg.org/#names-and-labels) for use with the whatwg-encoding or similar package.


interface Options

interface Options {}

    property defaultEncoding

    defaultEncoding?: string | undefined;
    • The ultimate fallback encoding used if no valid encoding is supplied by the transport layer, and no encoding is sniffed from the bytes.


      Which is recommended by the algorithm's table of suggested defaults for "All other locales" (including the en locale).

    property transportLayerEncodingLabel

    transportLayerEncodingLabel?: string | undefined;
    • An encoding label that is obtained from the "transport layer" (probably an HTTP Content-Type header), which overrides everything but a BOM.

    Package Files (1)

    Dependencies (1)

    Dev Dependencies (0)

    No dev dependencies.

    Peer Dependencies (0)

    No peer dependencies.


    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/@types/html-encoding-sniffer.

    • Markdown
    • HTML
      <a href="https://www.jsdocs.io/package/@types/html-encoding-sniffer"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>