{"name":"domhandler","version":"6.0.0","keywords":["dom","htmlparser2"],"author":{"name":"Felix Boehm","email":"me@feedic.com"},"license":"BSD-2-Clause","_id":"domhandler@6.0.0","maintainers":[{"name":"fb55","email":"me@feedic.com"}],"homepage":"https://github.com/fb55/domhandler#readme","bugs":{"url":"https://github.com/fb55/domhandler/issues"},"dist":{"shasum":"7496bb610f8b511e8d79594585b56fecd2452e76","tarball":"http://registry-npm.ywwl.com/domhandler/download/domhandler-6.0.0.tgz","fileCount":9,"integrity":"sha512-PclGSSdQKIWzeTTxBlxQzcDJ0trF19Y3chWMBkPls8yf3yw40bbGLx+Q09BZ6Lri72KTffAhrwK0ehujin57uA==","signatures":[{"sig":"MEUCIBVa2p1/9lr4A1f/YQpobaKbtn6htV7uh0xb2kCpaIHMAiEAoFOVTsVJTfhiw7R77NMDUc5MhD0UlF6pkNbAHzF5mGg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/domhandler@6.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":37229,"size":8825,"noattachment":false,"key":"/domhandler/-/domhandler-6.0.0.tgz"},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=20.19.0"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"funding":{"url":"https://github.com/fb55/domhandler?sponsor=1","type":"github"},"gitHead":"1346b9c6069862dc8ebc62cdaa4bac15303e427c","scripts":{"lint":"npm run lint:es && npm run lint:biome","test":"npm run test:vi && npm run lint","build":"tsc","format":"npm run format:es && npm run format:biome","lint:es":"eslint .","test:vi":"vitest run","format:es":"npm run lint:es -- --fix","build:docs":"typedoc --hideGenerator --plugin typedoc-plugin-missing-exports src/index.ts","lint:biome":"biome check .","format:biome":"biome check --write .","prepublishOnly":"npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:4bee8abc-952c-4286-b991-069efd0a0cb7"}},"repository":{"url":"git://github.com/fb55/domhandler.git","type":"git"},"_npmVersion":"11.9.0","description":"Handler for htmlparser2 that turns pages into a dom","directories":{},"sideEffects":false,"_nodeVersion":"24.14.0","dependencies":{"domelementtype":"^3.0.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^10.0.3","vitest":"^4.0.18","typedoc":"^0.27.9","typescript":"^5.8.3","@types/node":"^25.5.0","htmlparser2":"^10.1.0","@biomejs/biome":"^2.4.7","@eslint/compat":"^2.0.3","typescript-eslint":"^8.57.1","eslint-config-biome":"^2.1.3","@feedic/eslint-config":"^0.2.3","typedoc-plugin-missing-exports":"^3.1.0"},"_npmOperationalInternal":{"tmp":"tmp/domhandler_6.0.0_1773763313912_0.3149975942885037","host":"s3://npm-registry-packages-npm-production"},"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":1773763314050,"_cnpm_publish_time":1773763314050,"dist-tags":{"latest":"6.0.1"}}