@types/html-encoding-sniffer

  • Version 2.0.1
  • Published
  • 3.91 kB
  • 1 dependency
  • MIT license

Install

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

Overview

TypeScript definitions for html-encoding-sniffer

Index

Functions

function sniffHTMLEncoding

sniffHTMLEncoding: (buffer: any, 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.

Interfaces

interface Options

interface Options {}

    property defaultEncoding

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

      'windows-1252'

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

    property transportLayerEncodingLabel

    transportLayerEncodingLabel?: string;
    • 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.

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

    • Markdown
      [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/html-encoding-sniffer)
    • 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>