Gathering detailed insights and metrics for @types/html-encoding-sniffer
Gathering detailed insights and metrics for @types/html-encoding-sniffer
Gathering detailed insights and metrics for @types/html-encoding-sniffer
Gathering detailed insights and metrics for @types/html-encoding-sniffer
The repository for high quality TypeScript type definitions.
npm install @types/html-encoding-sniffer
Typescript
Module System
93.5
Supply Chain
86.2
Quality
75.4
Maintenance
100
Vulnerability
100
License
TypeScript (99.84%)
JavaScript (0.15%)
Shell (0.01%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
NOASSERTION License
50,021 Stars
89,735 Commits
30,435 Forks
640 Watchers
6 Branches
9,957 Contributors
Updated on Jul 11, 2025
Latest Version
3.0.2
Package Id
@types/html-encoding-sniffer@3.0.2
Unpacked Size
6.33 kB
Size
2.29 kB
File Count
5
Published on
Nov 07, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
npm install --save @types/html-encoding-sniffer
This package contains type definitions for html-encoding-sniffer (https://github.com/jsdom/html-encoding-sniffer#readme).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/html-encoding-sniffer.
1/** 2 * Determine the Encoding of a HTML Byte Stream. 3 * 4 * Implements the HTML Standard's 5 * [encoding sniffing algorithm](https://html.spec.whatwg.org/multipage/syntax.html#encoding-sniffing-algorithm) 6 * in all its glory. The most interesting part of this is how it pre-scans the first 1024 bytes in order to search 7 * for certain `<meta charset>`-related patterns. 8 * 9 * @param htmlBytes The typed array containing the (X)HTML source text. 10 * 11 * @return The canonical [encoding name](https://encoding.spec.whatwg.org/#names-and-labels) 12 * for use with the [`whatwg-encoding`](https://github.com/jsdom/whatwg-encoding) or similar package. 13 * 14 * @example 15 * import htmlEncodingSniffer = require("html-encoding-sniffer"); 16 * import * as fs from "fs"; 17 * 18 * const htmlBytes = fs.readFileSync("./html-page.html"); 19 * const sniffedEncoding = htmlEncodingSniffer(htmlBytes); 20 */ 21declare function sniffHTMLEncoding(htmlBytes: Uint8Array, options?: sniffHTMLEncoding.Options): string; 22 23declare namespace sniffHTMLEncoding { 24 interface Options { 25 /** 26 * An encoding label that is obtained from the "transport layer" 27 * (probably an HTTP `Content-Type` header), which overrides 28 * everything but a BOM. 29 */ 30 transportLayerEncodingLabel?: string | undefined; 31 32 /** 33 * The ultimate fallback encoding used if no valid encoding is supplied 34 * by the transport layer, and no encoding is sniffed from the bytes. 35 * 36 * @default 37 * ``` 38 * 'windows-1252' 39 * ``` 40 * 41 * Which is recommended by the algorithm's table of suggested 42 * defaults for "All other locales" (including the `en` locale). 43 */ 44 defaultEncoding?: string | undefined; 45 } 46} 47 48export = sniffHTMLEncoding; 49
These definitions were written by ExE Boss, and BendingBender.
No vulnerabilities found.
Reason
30 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 10
Reason
security policy file detected
Details
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
no binaries found in the repo
Reason
Found 27/30 approved changesets -- score normalized to 9
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 8
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Score
Last Scanned on 2025-07-07
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