HAST Utility: Is Event Handler

JSON →
library 3.0.1 ·javascript
verified May 27, 2026

This package provides a utility function, `isEventHandler`, to check if a given string represents a potential HTML event handler attribute name. It primarily identifies strings starting with 'on' and having a length of five or more characters (e.g., 'onclick', 'onmouseover'), without performing validation on the actual event handler's existence or validity. As part of the `unified` and `hast` ecosystem, it is designed for processing HTML Abstract Syntax Trees. The current stable version is `3.0.1`, maintained within the `rehypejs` monorepo, which generally coordinates major releases across its packages. It is ESM-only and requires Node.js 16 or newer. This tool differentiates itself by its focused scope within the `hast` ecosystem, offering a lightweight and specific check for attribute names.

total hits 13
actors 5 distinct systems
last hit 2d ago AhrefsBot
MetaBot
4
GPTBot
2
Script
1

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