HAST Utility to Parse CSS Selectors
JSON →`hast-util-parse-selector` is a focused utility within the `unified` ecosystem designed to create HAST (Hypertext Abstract Syntax Tree) element nodes from simple CSS selector strings. Currently at stable version 4.0.0, this package follows semantic versioning, with major releases typically aligning with dropping support for unmaintained Node.js versions. It processes basic selectors that can include a tag name, multiple class names, and a single ID, transforming them into a `hast` element object with corresponding `tagName` and `properties` (including `id` and `className` arrays). While powerful for its specific use case, it explicitly states its niche nature, recommending more comprehensive alternatives like `hastscript` or `hast-util-from-selector` for handling complex CSS selectors. Its primary differentiator is its simplicity and directness in parsing straightforward selectors into HAST nodes, making it suitable for scenarios where a full-blown selector engine is overkill.
Traffic · last 30 days ↑500% vs prev 7d
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇳🇴 Norway · 🇫🇷 France · 🇩🇪 Germany