Fast HTML Parser (version 1.0.1) is an HTML parsing library designed for high performance and low-cost processing of large HTML files, generating a simplified DOM tree with basic element query support. It prioritizes speed, often outperforming alternatives like older versions of `htmlparser2` in its benchmarks. Key differentiators include its focus on raw parsing speed and a simplified DOM structure. However, this package is effectively abandoned, with its last release over a decade ago. It lacks active maintenance, modern features, and critical security updates. For current projects requiring a fast HTML parser, `node-html-parser` (a separate, actively maintained package that appears to be a spiritual successor or re-implementation) is the recommended alternative, offering similar performance goals with ongoing development and broader feature support.
npm install fast-html-parserVerified import paths — ran on the pinned version, not inferred.
Demonstrates parsing HTML, accessing the root element, querying elements by ID and class, and extracting text and raw HTML content.
Migrate to an actively maintained alternative like `node-html-parser` for ongoing support and security updates.
Manually traverse the DOM tree for more complex selection criteria or use a different parser with full CSS selector support.
Be aware of this non-standard behavior. If you need all matches, you might need to implement a recursive search or use a different library.
Only enable these options if absolutely necessary for your parsing logic and be aware of the performance trade-offs.
Ensure HTML input is as well-formed as possible, or use a more forgiving, spec-compliant parser if robust error handling for malformed HTML is critical.
Use CommonJS `require` syntax: `const HTMLParser = require('fast-html-parser'); const root = HTMLParser.parse(...)`.This package is CommonJS-only. For modern ESM environments, consider using `node-html-parser` which offers ESM support, or dynamically import this package using `import('fast-html-parser').then(mod => mod.parse(...))` (though not officially supported/tested for this old package).No dependency data recorded yet.