{"type":"module","name":"domhandler","version":"6.0.1","description":"Handler for htmlparser2 that turns pages into a dom","author":{"name":"Felix Boehm","email":"me@feedic.com"},"funding":{"type":"github","url":"https://github.com/fb55/domhandler?sponsor=1"},"license":"BSD-2-Clause","main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"sideEffects":false,"scripts":{"build":"tsc","build:docs":"typedoc --hideGenerator --plugin typedoc-plugin-missing-exports src/index.ts","format":"npm run format:es && npm run format:biome","format:biome":"biome check --write .","format:es":"npm run lint:es -- --fix","lint":"npm run lint:es && npm run lint:biome","lint:biome":"biome check .","lint:es":"eslint .","prepublishOnly":"npm run build","test":"npm run test:vi && npm run lint","test:vi":"vitest run"},"repository":{"type":"git","url":"git://github.com/fb55/domhandler.git"},"keywords":["dom","htmlparser2"],"engines":{"node":">=20.19.0"},"dependencies":{"domelementtype":"^3.0.0"},"devDependencies":{"@biomejs/biome":"^2.4.7","@eslint/compat":"^2.0.3","@feedic/eslint-config":"^0.3.1","@types/node":"^25.5.0","eslint":"^10.0.3","eslint-config-biome":"^2.1.3","htmlparser2":"^10.1.0","typedoc":"^0.27.9","typedoc-plugin-missing-exports":"^3.1.0","typescript":"^5.8.3","typescript-eslint":"^8.57.1","vitest":"^4.0.18"},"gitHead":"8f6607116643ed59b44acabe0ec0675adbcbb253","_id":"domhandler@6.0.1","bugs":{"url":"https://github.com/fb55/domhandler/issues"},"homepage":"https://github.com/fb55/domhandler#readme","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-gYzvtM72ZtxQO0T048kd6HWSbbGCNOUwcnfQ01cqIJ4X2IYKFFHZ5mKvrQETcFXxsRObZulDaKmy//R7TPtsBg==","shasum":"75f351a03a6e10c35e08418f9cf0d287e00797cf","tarball":"http://registry-npm.ywwl.com/domhandler/download/domhandler-6.0.1.tgz","fileCount":9,"unpackedSize":37229,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/domhandler@6.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIA38r9cSY+MLms9qrIVm1o442dDvotMJkdVlZ4dz4RlWAiA0RE4dM8JZU43pZ+gyaF75G/WpgM6CuvuH32alHt58bA=="}],"size":8823,"noattachment":false,"key":"/domhandler/-/domhandler-6.0.1.tgz"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:4bee8abc-952c-4286-b991-069efd0a0cb7"}},"directories":{},"maintainers":[{"name":"fb55","email":"me@feedic.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/domhandler_6.0.1_1773764690433_0.032157892669810506"},"_hasShrinkwrap":false,"readme":"# domhandler [![Node.js CI](https://github.com/fb55/domhandler/actions/workflows/nodejs-test.yml/badge.svg)](https://github.com/fb55/domhandler/actions/workflows/nodejs-test.yml)\n\nThe DOM handler creates a tree containing all nodes of a page.\nThe tree can be manipulated using the [domutils](https://github.com/fb55/domutils)\nor [cheerio](https://github.com/cheeriojs/cheerio) libraries and\nrendered using [dom-serializer](https://github.com/cheeriojs/dom-serializer) .\n\n## Usage\n\n```javascript\nconst handler = new DomHandler([ <func> callback(err, dom), ] [ <obj> options ]);\n// const parser = new Parser(handler[, options]);\n```\n\nAvailable options are described below.\n\n## Example\n\n```javascript\nconst { Parser } = require(\"htmlparser2\");\nconst { DomHandler } = require(\"domhandler\");\nconst rawHtml =\n    \"Xyz <script language= javascript>var foo = '<<bar>>';</script><!--<!-- Waah! -- -->\";\nconst handler = new DomHandler((error, dom) => {\n    if (error) {\n        // Handle error\n    } else {\n        // Parsing completed, do something\n        console.log(dom);\n    }\n});\nconst parser = new Parser(handler);\nparser.write(rawHtml);\nparser.end();\n```\n\nOutput:\n\n```javascript\n[\n    {\n        data: \"Xyz \",\n        type: \"text\",\n    },\n    {\n        type: \"script\",\n        name: \"script\",\n        attribs: {\n            language: \"javascript\",\n        },\n        children: [\n            {\n                data: \"var foo = '<bar>';<\",\n                type: \"text\",\n            },\n        ],\n    },\n    {\n        data: \"<!-- Waah! -- \",\n        type: \"comment\",\n    },\n];\n```\n\n## Option: `withStartIndices`\n\nAdd a `startIndex` property to nodes.\nWhen the parser is used in a non-streaming fashion, `startIndex` is an integer\nindicating the position of the start of the node in the document.\nThe default value is `false`.\n\n## Option: `withEndIndices`\n\nAdd an `endIndex` property to nodes.\nWhen the parser is used in a non-streaming fashion, `endIndex` is an integer\nindicating the position of the end of the node in the document.\nThe default value is `false`.\n\n---\n\nLicense: BSD-2-Clause\n\n## Security contact information\n\nTo report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security).\nTidelift will coordinate the fix and disclosure.\n","publish_time":1773764690639,"_cnpm_publish_time":1773764690639,"dist-tags":{"latest":"6.0.1"}}