Just released a tiny Node module that parses the attributes from a single tag (any attribute from anything that looks like a tag, not just valid attributes from HTML tags).
https://codeberg.org/small-tech/attribute-parser
(Regular expressions just don’t cut it when you want to support boolean attributes as well as attributes with dashes in the names and unquoted, single-quoted, and double-quoted values.)