← All repos

htmlparser2

The fast & forgiving HTML and XML parser

domhtmlhtml-parserhtmlparser2javascriptparserxml
Browse cluster: HTML Parsing & Error Tracking
2,394commits
73contributors
3languages

Tech stack & purpose

htmlparser2 is a fast and forgiving HTML and XML parser written in JavaScript. The project provides a callback-based interface for parsing documents with minimal memory allocations, and includes helper functions for building and querying DOM trees, serializing modified documents back to HTML, and parsing RSS, RDF, and Atom feeds. It is part of an ecosystem that includes related tools like domhandler, domutils, css-select, cheerio, and dom-serializer for more ergonomic DOM manipulation and querying. According to benchmarks, htmlparser2 is the fastest HTML parser available, though it prioritizes speed over strict HTML specification compliance.

Languages

TypeScript
98.0%
JavaScript
1.2%
HTML
0.8%

Contributors (top 30 of 73)