{"id":19551353,"url":"https://github.com/victrme/slim-htmlparser2","last_synced_at":"2026-01-30T04:11:04.593Z","repository":{"id":262162357,"uuid":"886398865","full_name":"victrme/slim-htmlparser2","owner":"victrme","description":"The fast \u0026 forgiving HTML parser, slimmed down.","archived":false,"fork":false,"pushed_at":"2024-11-16T14:30:31.000Z","size":169,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-21T03:46:17.684Z","etag":null,"topics":["deno","html","htmlparser2","javascript","parser"],"latest_commit_sha":null,"homepage":"https://jsr.io/@victr/slim-htmlparser2","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/victrme.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-10T22:14:57.000Z","updated_at":"2025-05-25T12:58:12.000Z","dependencies_parsed_at":"2024-11-10T23:24:05.514Z","dependency_job_id":"249ab7f9-ddf1-4de0-bc07-fb6bd2959732","html_url":"https://github.com/victrme/slim-htmlparser2","commit_stats":null,"previous_names":["victrme/slim-htmlparser2"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/victrme/slim-htmlparser2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victrme%2Fslim-htmlparser2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victrme%2Fslim-htmlparser2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victrme%2Fslim-htmlparser2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victrme%2Fslim-htmlparser2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/victrme","download_url":"https://codeload.github.com/victrme/slim-htmlparser2/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victrme%2Fslim-htmlparser2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28900980,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T04:02:34.702Z","status":"ssl_error","status_checked_at":"2026-01-30T04:02:33.562Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deno","html","htmlparser2","javascript","parser"],"created_at":"2024-11-11T04:13:38.262Z","updated_at":"2026-01-30T04:11:04.570Z","avatar_url":"https://github.com/victrme.png","language":"TypeScript","readme":"# slim-htmlparser2\n\n[![NPM Version](https://img.shields.io/npm/v/htmlparser2?color=%23cb3837)](https://npmjs.org/package/htmlparser2)\n[![JSR Version](\u003chttps://img.shields.io/jsr/v/%40victr/slim-htmlparser2?color=rgb(247%2C%20223%2C%2030)\u003e)](https://jsr.io/@victr/slim-htmlparser2)\n[![Downloads](https://img.shields.io/npm/dm/htmlparser2.svg)](https://npmjs.org/package/htmlparser2)\n\nThe fast \u0026 forgiving HTML parser, only with Parser.\n\n_htmlparser2 is [the fastest HTML parser](#performance), and takes some shortcuts to get there._\n\n## Usage\n\n`htmlparser2` itself provides a callback interface that allows consumption of documents with minimal allocations.\n\n```js\nimport * as htmlparser2 from '@victr/htmlparser2'\n\nconst parser = new htmlparser2.Parser({\n  onopentag(name, attributes) {\n    if (name === 'script' \u0026\u0026 attributes.type === 'text/javascript') {\n      console.log('JS! Hooray!')\n    }\n  },\n  ontext(text) {\n    console.log('--\u003e', text)\n  },\n  onclosetag(tagname) {\n    if (tagname === 'script') {\n      console.log(\"That's it?!\")\n    }\n  },\n})\nparser.write(\"Xyz \u003cscript type='text/javascript'\u003econst foo = '\u003c\u003cbar\u003e\u003e';\u003c/script\u003e\")\nparser.end()\n```\n\nOutput (with multiple text events combined):\n\n```\n--\u003e Xyz\nJS! Hooray!\n--\u003e const foo = '\u003c\u003cbar\u003e\u003e';\nThat's it?!\n```\n\n## Performance\n\n```\nhtmlparser2        : 2.17215 ms/file ± 3.81587\nnode-html-parser   : 2.35983 ms/file ± 1.54487\nhtml5parser        : 2.43468 ms/file ± 2.81501\nneutron-html5parser: 2.61356 ms/file ± 1.70324\nhtmlparser2-dom    : 3.09034 ms/file ± 4.77033\nhtml-dom-parser    : 3.56804 ms/file ± 5.15621\nlibxmljs           : 4.07490 ms/file ± 2.99869\nhtmljs-parser      : 6.15812 ms/file ± 7.52497\nparse5             : 9.70406 ms/file ± 6.74872\nhtmlparser         : 15.0596 ms/file ± 89.0826\nhtml-parser        : 28.6282 ms/file ± 22.6652\nsaxes              : 45.7921 ms/file ± 128.691\nhtml5              : 120.844 ms/file ± 153.944\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictrme%2Fslim-htmlparser2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvictrme%2Fslim-htmlparser2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictrme%2Fslim-htmlparser2/lists"}