HTML5 Parser
JSON →html5parser is a highly performant and compact JavaScript library designed for parsing HTML5 documents. Currently at version 2.0.2, it provides functionalities to tokenize and parse HTML strings into a structured Abstract Syntax Tree (AST). It distinguishes itself through its speed, tiny bundle size (under 5kb), and cross-platform compatibility, running effectively in both modern browsers and Node.js environments. A key design principle is its strict adherence to the HTML5 specification; any content not compliant with HTML5 will be ignored. The library offers both low-level tokenization (`tokenize`) and higher-level AST generation (`parse`), along with utilities like `walk` for traversing the AST and `safeHtml` for sanitization. It ships with TypeScript types, promoting better developer experience and type safety. The release cadence appears to be driven by dependency updates and bug fixes, with `2.0.2` specifically noting dependency updates, suggesting a focus on stability and maintenance.
Traffic · last 30 days ↑600% vs prev 7d
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇩🇪 Germany · 🇫🇮 Finland · 🇫🇷 France