HAST Element Check Utility

JSON →
library 3.0.0 ·javascript
verified May 27, 2026

This package, `hast-util-is-element`, is a fundamental utility within the HAST (Hypertext Abstract Syntax Tree) ecosystem, primarily designed to check if a given HAST node represents an HTML element. It offers flexible testing capabilities, allowing developers to verify not only if a node is an element but also if it matches specific tag names, an array of tag names, or even complex criteria through a predicate function. The library is currently stable at version 3.0.0, which introduced significant changes, including a migration to ESM-only distribution and a requirement for Node.js 16 or newer. Its release cadence is generally tied to updates within the broader syntax-tree ecosystem, including HAST type definition improvements and Node.js version alignment. A key differentiator is its specialized focus on HAST nodes, providing a more targeted and potentially performant alternative compared to the more generic `unist-util-is` for general Unist nodes. For advanced matching based on CSS selectors, `hast-util-select` offers more robust capabilities, positioning `hast-util-is-element` as a lightweight yet powerful tool for basic and custom element checks.

total hits 27
actors 7 distinct systems
last hit 2d ago AhrefsBot
MetaBot
4
GPTBot
2
Script
1
Search engines
2

top countries 🇨🇦 Canada · 🇺🇸 United States · 🇳🇴 Norway · 🇫🇷 France · 🇩🇪 Germany