{
  "manifest": {
    "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": "https://github.com/jsdom/html-encoding-sniffer.git"
    },
    "main": "lib/html-encoding-sniffer.js",
    "files": [
      "lib/"
    ],
    "scripts": {
      "test": "mocha",
      "lint": "eslint ."
    },
    "dependencies": {
      "whatwg-encoding": "^1.0.5"
    },
    "devDependencies": {
      "eslint": "^6.8.0",
      "mocha": "^7.0.0"
    },
    "engines": {
      "node": ">=10"
    },
    "_registry": "npm",
    "_loc": "/homez.1033/heliovt/.cache/yarn/v6/npm-html-encoding-sniffer-2.0.1-42a6dc4fd33f00281176e8b23759ca4e4fa185f3-integrity/node_modules/html-encoding-sniffer/package.json",
    "readmeFilename": "README.md",
    "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.\n",
    "licenseText": "Copyright © 2016–2020 Domenic Denicola <d@domenic.me>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  "artifacts": [],
  "remote": {
    "resolved": "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz#42a6dc4fd33f00281176e8b23759ca4e4fa185f3",
    "type": "tarball",
    "reference": "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz",
    "hash": "42a6dc4fd33f00281176e8b23759ca4e4fa185f3",
    "integrity": "sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ==",
    "registry": "npm",
    "packageName": "html-encoding-sniffer",
    "cacheIntegrity": "sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ== sha1-QqbcT9M/ACgRduiyN1nKTk+hhfM="
  },
  "registry": "npm",
  "hash": "42a6dc4fd33f00281176e8b23759ca4e4fa185f3"
}