Fast & forgiving HTML/XML/RSS parser
npm install @ray-core/htmlparser2



A forgiving HTML/XML/RSS parser.
The parser can handle streams and provides a callback interface.
npm install htmlparser2
A live demo of htmlparser2 is available here.
``javascript
const htmlparser2 = require("htmlparser2");
const parser = new htmlparser2.Parser(
{
onopentag(name, attribs) {
if (name === "script" && attribs.type === "text/javascript") {
console.log("JS! Hooray!");
}
},
ontext(text) {
console.log("-->", text);
},
onclosetag(tagname) {
if (tagname === "script") {
console.log("That's it?!");
}
}
},
{ decodeEntities: true }
);
parser.write(
"Xyz