{
	"name": "html-encoding-sniffer",
	"versions": {
		"1.0.0": {
			"name": "html-encoding-sniffer",
			"description": "Sniff the encoding from a HTML byte stream",
			"keywords": [
				"encoding",
				"html"
			],
			"version": "1.0.0",
			"author": {
				"name": "Domenic Denicola",
				"email": "d@domenic.me",
				"url": "https://domenic.me/"
			},
			"license": "WTFPL",
			"repository": {
				"type": "git",
				"url": "git+https://github.com/jsdom/html-encoding-sniffer.git"
			},
			"main": "lib/html-encoding-sniffer.js",
			"files": [
				"lib/"
			],
			"scripts": {
				"test": "mocha",
				"lint": "eslint lib test"
			},
			"dependencies": {
				"whatwg-encoding": "^1.0.1"
			},
			"devDependencies": {
				"eslint": "^3.8.0",
				"mocha": "^3.1.2"
			},
			"gitHead": "8cd325d2e567e33dec4f0fa489c556e0e290db5d",
			"bugs": {
				"url": "https://github.com/jsdom/html-encoding-sniffer/issues"
			},
			"homepage": "https://github.com/jsdom/html-encoding-sniffer#readme",
			"_id": "html-encoding-sniffer@1.0.0",
			"_shasum": "19f93ff0d070bd3c238f1ff16ea2f68cc0d42c96",
			"_from": ".",
			"_npmVersion": "3.9.5",
			"_nodeVersion": "6.2.2",
			"_npmUser": {
				"name": "domenic",
				"email": "d@domenic.me"
			},
			"dist": {
				"shasum": "19f93ff0d070bd3c238f1ff16ea2f68cc0d42c96",
				"tarball": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.0.tgz"
			},
			"maintainers": [
				{
					"name": "domenic",
					"email": "d@domenic.me"
				}
			],
			"_npmOperationalInternal": {
				"host": "packages-16-east.internal.npmjs.com",
				"tmp": "tmp/html-encoding-sniffer-1.0.0.tgz_1476589995029_0.5327760553918779"
			},
			"directories": {},
			"contributors": []
		},
		"1.0.1": {
			"name": "html-encoding-sniffer",
			"description": "Sniff the encoding from a HTML byte stream",
			"keywords": [
				"encoding",
				"html"
			],
			"version": "1.0.1",
			"author": {
				"name": "Domenic Denicola",
				"email": "d@domenic.me",
				"url": "https://domenic.me/"
			},
			"license": "WTFPL",
			"repository": {
				"type": "git",
				"url": "git+https://github.com/jsdom/html-encoding-sniffer.git"
			},
			"main": "lib/html-encoding-sniffer.js",
			"files": [
				"lib/"
			],
			"scripts": {
				"test": "mocha",
				"lint": "eslint lib test"
			},
			"dependencies": {
				"whatwg-encoding": "^1.0.1"
			},
			"devDependencies": {
				"eslint": "^3.8.0",
				"mocha": "^3.1.2"
			},
			"gitHead": "9b4a785caf193f8852770b7dfc7194431fbf8bed",
			"bugs": {
				"url": "https://github.com/jsdom/html-encoding-sniffer/issues"
			},
			"homepage": "https://github.com/jsdom/html-encoding-sniffer#readme",
			"_id": "html-encoding-sniffer@1.0.1",
			"_shasum": "79bf7a785ea495fe66165e734153f363ff5437da",
			"_from": ".",
			"_npmVersion": "3.9.5",
			"_nodeVersion": "6.2.2",
			"_npmUser": {
				"name": "domenic",
				"email": "d@domenic.me"
			},
			"dist": {
				"shasum": "79bf7a785ea495fe66165e734153f363ff5437da",
				"tarball": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.1.tgz"
			},
			"maintainers": [
				{
					"name": "domenic",
					"email": "d@domenic.me"
				}
			],
			"_npmOperationalInternal": {
				"host": "packages-12-west.internal.npmjs.com",
				"tmp": "tmp/html-encoding-sniffer-1.0.1.tgz_1476591787938_0.5426098443567753"
			},
			"directories": {},
			"contributors": []
		},
		"1.0.2": {
			"name": "html-encoding-sniffer",
			"description": "Sniff the encoding from a HTML byte stream",
			"keywords": [
				"encoding",
				"html"
			],
			"version": "1.0.2",
			"author": {
				"name": "Domenic Denicola",
				"email": "d@domenic.me",
				"url": "https://domenic.me/"
			},
			"license": "MIT",
			"repository": {
				"type": "git",
				"url": "git+https://github.com/jsdom/html-encoding-sniffer.git"
			},
			"main": "lib/html-encoding-sniffer.js",
			"files": [
				"lib/"
			],
			"scripts": {
				"test": "mocha",
				"lint": "eslint lib test"
			},
			"dependencies": {
				"whatwg-encoding": "^1.0.1"
			},
			"devDependencies": {
				"eslint": "^3.8.0",
				"mocha": "^3.1.2"
			},
			"gitHead": "8d69308c38af4b19170d2caeac6e16c6f52f5e01",
			"bugs": {
				"url": "https://github.com/jsdom/html-encoding-sniffer/issues"
			},
			"homepage": "https://github.com/jsdom/html-encoding-sniffer#readme",
			"_id": "html-encoding-sniffer@1.0.2",
			"_npmVersion": "5.4.2",
			"_nodeVersion": "8.6.0",
			"_npmUser": {
				"name": "domenic",
				"email": "d@domenic.me"
			},
			"dist": {
				"integrity": "sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw==",
				"shasum": "e70d84b94da53aa375e11fe3a351be6642ca46f8",
				"tarball": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz"
			},
			"maintainers": [
				{
					"name": "domenic",
					"email": "d@domenic.me"
				}
			],
			"_npmOperationalInternal": {
				"host": "s3://npm-registry-packages",
				"tmp": "tmp/html-encoding-sniffer-1.0.2.tgz_1508717756193_0.17921806732192636"
			},
			"directories": {},
			"contributors": []
		},
		"2.0.0": {
			"name": "html-encoding-sniffer",
			"description": "Sniff the encoding from a HTML byte stream",
			"keywords": [
				"encoding",
				"html"
			],
			"version": "2.0.0",
			"author": {
				"name": "Domenic Denicola",
				"email": "d@domenic.me",
				"url": "https://domenic.me/"
			},
			"license": "MIT",
			"repository": {
				"type": "git",
				"url": "git+https://github.com/jsdom/html-encoding-sniffer.git"
			},
			"main": "lib/html-encoding-sniffer.js",
			"scripts": {
				"test": "mocha",
				"lint": "eslint ."
			},
			"dependencies": {
				"whatwg-encoding": "^1.0.5"
			},
			"devDependencies": {
				"eslint": "^6.8.0",
				"mocha": "^7.0.0"
			},
			"engines": {
				"node": ">=10"
			},
			"gitHead": "c5e8fe3539a6ad4be2ffe5e5d61060885e3f6d64",
			"bugs": {
				"url": "https://github.com/jsdom/html-encoding-sniffer/issues"
			},
			"homepage": "https://github.com/jsdom/html-encoding-sniffer#readme",
			"_id": "html-encoding-sniffer@2.0.0",
			"_nodeVersion": "12.1.0",
			"_npmVersion": "6.9.0",
			"dist": {
				"integrity": "sha512-Y9prnPKkM7FXxQevZ5UH8Z6aVTY0ede1tHquck5UxGmKWDshxXh95gSa2xXYjS8AsGO5iOvrCI5+GttRKnLdNA==",
				"shasum": "70b3b69bb5999f35d0d4495d79079f35630e71ae",
				"tarball": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.0.tgz",
				"fileCount": 4,
				"unpackedSize": 11183,
				"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeEhkaCRA9TVsSAnZWagAAY3gP/A2kdlKGHR8WGwgG6fU/\nUvrYvRfaNQddDNedUwRuZG8Va63QMeeU8tTe8UyphPyqrbhOJLN88oTR7sOm\n//ZZGL8PIHIr+KCqPUWbld8Jf7DcJBQ/8VgyyH1vlQhQ33M5TEEFsjNesoSz\nWY8fvZGBgd4oAbt3rd9gh2f2DTlcwD28t6Oy6V5U1K+BfHm3hi/hnsYuGaa4\nH/6EyoE5Zbjg0rlMZo6TX7LRk90/K4SEkf0MoDsGN1zjg3JJE1QtFI+JEJsc\nkzlEWhRoCAMwGjzc8JjhsaYmRd42BG8EAmhc67sFX4UUOwGQIbQCXrVdxVCY\nHbVbw+qGkwiHO4KExBDVrdUVM9HpZdSp+N8mOufSNUXKOSiAomZlt9xYoFFG\nDvna8ZAELVeXKdsEVKRqtlmEjy2NCCJvannsHMtjq83iAKmrNCKNsBQbxDqY\nwT52Y6PDelZ2/DWJY8b5Qexw/vpdPq84bbBoAvDHCsxRpX7GegyBcOMOdczC\nFgB+eEquEx/0I6M6sHpRLWW2ksSfci9q9MTPZFVGNo6/IrXRmxebAixwoqYY\nqWq9F4es5uig7PR2BAgfmk28bv9ITrUk1bFGpOVu3mO+MyT32bNQpkabnnkR\nPFXXTFqPSrU6Iu78brd4owMlYuAMiOIceQQqWgsFd31urNXIGoqymCM7hgL3\nozTt\r\n=L2Z3\r\n-----END PGP SIGNATURE-----\r\n"
			},
			"maintainers": [
				{
					"email": "d@domenic.me",
					"name": "domenic"
				},
				{
					"email": "joris@jorisvanderwel.com",
					"name": "joris-van-der-wel"
				},
				{
					"email": "sebmaster16@gmail.com",
					"name": "sebmaster"
				},
				{
					"email": "timothygu99@gmail.com",
					"name": "timothygu"
				},
				{
					"email": "tmpvar@gmail.com",
					"name": "tmpvar"
				},
				{
					"email": "code@zirro.se",
					"name": "zirro"
				}
			],
			"_npmUser": {
				"name": "domenic",
				"email": "d@domenic.me"
			},
			"directories": {},
			"_npmOperationalInternal": {
				"host": "s3://npm-registry-packages",
				"tmp": "tmp/html-encoding-sniffer_2.0.0_1578244378061_0.49863360811709123"
			},
			"_hasShrinkwrap": false,
			"contributors": []
		},
		"2.0.1": {
			"name": "html-encoding-sniffer",
			"description": "Sniff the encoding from a HTML byte stream",
			"keywords": [
				"encoding",
				"html"
			],
			"version": "2.0.1",
			"author": {
				"name": "Domenic Denicola",
				"email": "d@domenic.me",
				"url": "https://domenic.me/"
			},
			"license": "MIT",
			"repository": {
				"type": "git",
				"url": "git+https://github.com/jsdom/html-encoding-sniffer.git"
			},
			"main": "lib/html-encoding-sniffer.js",
			"scripts": {
				"test": "mocha",
				"lint": "eslint ."
			},
			"dependencies": {
				"whatwg-encoding": "^1.0.5"
			},
			"devDependencies": {
				"eslint": "^6.8.0",
				"mocha": "^7.0.0"
			},
			"engines": {
				"node": ">=10"
			},
			"gitHead": "24a3f567dcffa23ef6d2c3f238b1299f7a71569f",
			"bugs": {
				"url": "https://github.com/jsdom/html-encoding-sniffer/issues"
			},
			"homepage": "https://github.com/jsdom/html-encoding-sniffer#readme",
			"_id": "html-encoding-sniffer@2.0.1",
			"_nodeVersion": "13.6.0",
			"_npmVersion": "6.13.4",
			"dist": {
				"integrity": "sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ==",
				"shasum": "42a6dc4fd33f00281176e8b23759ca4e4fa185f3",
				"tarball": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz",
				"fileCount": 4,
				"unpackedSize": 11469,
				"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeUvxeCRA9TVsSAnZWagAAv58P/1SkBqtI50/P0EkZosfD\ns1kSdWcWYhpD/ENunOEAmq+sD6uNIppAP8X+h24ExIpdIIxxh+ouA/LxRh0J\nK8TT/XSrXk0AqGIgScFYD+guPXe08+xUxuNzf5DEmIa1TPeTTosoNiGdFIsK\n90rw01PVqvIVgu08hTBQjEWeiT+C3LfiC37Sm1kRkW+7+Lo+56Z0HjNiPyEr\nBFl9wPBWOETYuTb9Ff+d0KVseqF5FXEcsJhDJIerFJGZRUuaIZ8Z+ir9INPk\nnMYoxj4ZB6sNCSOXBdrtBrSVe2xM4mJNUOuWMgaxTyRNbGo7TFIVvWg6uqkq\nbcWfyeYkwujj2SgNtudxao4ZOloOO5n0P1qNFRNowfbMwMNSOQsHSasY788K\nxvbtuwD6lEtox5gJmWf05s+l+S1NoLB9RDMna+UCth2ShxQE6//LQt3763JT\n/j6MzEqTGyCAYOIVPOrkPqvXdsjNnRFiN1e9f7hbLb+t6+1AXgX6b1WnH/m9\n/dgbIuszO2FGh226jM5MxPcCTWNKuAksfuJn7vU0DsqYqLs3DqphA1V8R5f0\n1fNqAojPfIUlGv5N/bpgDdHm+IA4Cbz20bfovyUUguFUjJHwa+/STYLCy2uM\nX/5qhUZxRmLooaCeEeISQjD+aF3Cqc9VERvlL4DIx7gkGRodc5dGikGngDE8\nsQ3g\r\n=7eGa\r\n-----END PGP SIGNATURE-----\r\n"
			},
			"maintainers": [
				{
					"email": "d@domenic.me",
					"name": "domenic"
				},
				{
					"email": "joris@jorisvanderwel.com",
					"name": "joris-van-der-wel"
				},
				{
					"email": "sebmaster16@gmail.com",
					"name": "sebmaster"
				},
				{
					"email": "timothygu99@gmail.com",
					"name": "timothygu"
				},
				{
					"email": "tmpvar@gmail.com",
					"name": "tmpvar"
				},
				{
					"email": "code@zirro.se",
					"name": "zirro"
				}
			],
			"_npmUser": {
				"name": "domenic",
				"email": "d@domenic.me"
			},
			"directories": {},
			"_npmOperationalInternal": {
				"host": "s3://npm-registry-packages",
				"tmp": "tmp/html-encoding-sniffer_2.0.1_1582496861635_0.25573667939106226"
			},
			"_hasShrinkwrap": false,
			"contributors": []
		}
	},
	"time": {
		"modified": "2020-02-23T22:27:44.145Z",
		"created": "2016-10-16T03:53:16.596Z",
		"1.0.0": "2016-10-16T03:53:16.596Z",
		"1.0.1": "2016-10-16T04:23:09.751Z",
		"1.0.2": "2017-10-23T00:15:57.146Z",
		"2.0.0": "2020-01-05T17:12:58.185Z",
		"2.0.1": "2020-02-23T22:27:41.834Z"
	},
	"users": {},
	"dist-tags": {
		"latest": "2.0.1"
	},
	"_uplinks": {
		"npmjs": {
			"etag": "W/\"50eb0c5a965f7bbdefb1bc4fdf7b4b27\"",
			"fetched": 1593324321230
		}
	},
	"_distfiles": {
		"html-encoding-sniffer-1.0.0.tgz": {
			"url": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.0.tgz",
			"sha": "19f93ff0d070bd3c238f1ff16ea2f68cc0d42c96",
			"registry": "npmjs"
		},
		"html-encoding-sniffer-1.0.1.tgz": {
			"url": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.1.tgz",
			"sha": "79bf7a785ea495fe66165e734153f363ff5437da",
			"registry": "npmjs"
		},
		"html-encoding-sniffer-1.0.2.tgz": {
			"url": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz",
			"sha": "e70d84b94da53aa375e11fe3a351be6642ca46f8",
			"registry": "npmjs"
		},
		"html-encoding-sniffer-2.0.0.tgz": {
			"url": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.0.tgz",
			"sha": "70b3b69bb5999f35d0d4495d79079f35630e71ae",
			"registry": "npmjs"
		},
		"html-encoding-sniffer-2.0.1.tgz": {
			"url": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz",
			"sha": "42a6dc4fd33f00281176e8b23759ca4e4fa185f3",
			"registry": "npmjs"
		}
	},
	"_attachments": {
		"html-encoding-sniffer-1.0.2.tgz": {
			"shasum": "e70d84b94da53aa375e11fe3a351be6642ca46f8"
		}
	},
	"_rev": "2-5f9bd6abfad821c7",
	"_id": "html-encoding-sniffer",
	"readme": "# Determine the Encoding of a HTML Byte Stream\n\nThis package implements the HTML Standard's [encoding sniffing algorithm](https://html.spec.whatwg.org/multipage/syntax.html#encoding-sniffing-algorithm) in all its glory. The most interesting part of this is how it pre-scans the first 1024 bytes in order to search for certain `<meta charset>`-related patterns.\n\n```js\nconst htmlEncodingSniffer = require(\"html-encoding-sniffer\");\nconst fs = require(\"fs\");\n\nconst htmlBuffer = fs.readFileSync(\"./html-page.html\");\nconst sniffedEncoding = htmlEncodingSniffer(htmlBuffer);\n```\n\nThe returned value will be a canonical [encoding name](https://encoding.spec.whatwg.org/#names-and-labels) (not a label). You might then combine this with the [whatwg-encoding](https://github.com/jsdom/whatwg-encoding) package to decode the result:\n\n```js\nconst whatwgEncoding = require(\"whatwg-encoding\");\nconst htmlString = whatwgEncoding.decode(htmlBuffer, sniffedEncoding);\n```\n\n## Options\n\nYou can pass two potential options to `htmlEncodingSniffer`:\n\n```js\nconst sniffedEncoding = htmlEncodingSniffer(htmlBuffer, {\n  transportLayerEncodingLabel,\n  defaultEncoding\n});\n```\n\nThese represent two possible inputs into the [encoding sniffing algorithm](https://html.spec.whatwg.org/multipage/syntax.html#encoding-sniffing-algorithm):\n\n- `transportLayerEncodingLabel` is an encoding label that is obtained from the \"transport layer\" (probably a HTTP `Content-Type` header), which overrides everything but a BOM.\n- `defaultEncoding` is the ultimate fallback encoding used if no valid encoding is supplied by the transport layer, and no encoding is sniffed from the bytes. It defaults to `\"windows-1252\"`, as recommended by the algorithm's table of suggested defaults for \"All other locales\" (including the `en` locale).\n\n## Credits\n\nThis package was originally based on the excellent work of [@nicolashenry](https://github.com/nicolashenry), [in jsdom](https://github.com/tmpvar/jsdom/blob/16fd85618f2705d181232f6552125872a37164bc/lib/jsdom/living/helpers/encoding.js). It has since been pulled out into this separate package."
}