fb55/htmlparser2

The fast & forgiving HTML and XML parser

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 48 minutes ago
Added to GitGenius on September 14th, 2026
Created on August 27th, 2011
Open Issues & Pull Requests: 13 (+0)
GitHub issues: Enabled
Number of forks: 402
Total Stargazers: 4,789 (+0)
Total Subscribers: 51 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 41.1 days
Mean response time: 129.0 days
90th percentile: 443.3 days
Tracked items: 27

Most active contributors

Sign in to see contributor activity.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 2
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 96 days
Stale 30+ days: 2
Stale 90+ days: 0

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • good-first-issue (2)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

htmlparser2 is a fast and forgiving HTML and XML parser written in TypeScript.

The tool addresses the need for rapid parsing of HTML and XML documents while prioritizing speed over strict specification compliance. It provides a callback-based interface that emits parser events as it processes documents, allowing consumers to handle opening tags, closing tags, text content, comments, CDATA sections, processing instructions, and errors with minimal memory overhead. This event-driven approach enables streaming-style consumption of documents without requiring the entire parse tree to be held in memory at once.

Developers should choose htmlparser2 if performance is a priority and they can tolerate lenient parsing behavior. It suits projects that need to process large volumes of HTML or XML quickly, such as web scrapers, feed readers, or build tools. The project explicitly acknowledges that if strict HTML specification compliance is required, parse5 is a better alternative. For ergonomic DOM manipulation, the tool integrates with a broader ecosystem including domhandler for DOM construction, domutils for DOM utilities, css-select for CSS selector support, and cheerio for a jQuery-like API.

The project maintains active engagement with its codebase through regular updates and refinements. Development shows consistent attention to performance optimization and parser correctness. The tool receives ongoing maintenance that addresses edge cases and parser behavior improvements. Community contributions are actively reviewed and integrated into the codebase.