
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
For use with htmlparser2, which is great as a parser, but kind of got off the tracks with its DomHandler implementation, which was fractured into two repositories, fb55/domhandler and fb55/DomUtils, and uses arbitrary names in its implementation.
This repository, domlike, replaces both DomHandler and DomUtils (as well as the strange and premature domelementtype), and seeks to implement most of the DOM2/DOM3 standard for Node.
Install:
npm install --save domlike htmlparser2
Use:
var request = require('request');
var htmlparser2 = require('htmlparser2');
var domlike = require('domlike');
request.get('http://henrian.com', function(err, res, body) {
if (err) throw err;
var handler = new domlike.Handler(function(err, document) {
if (err) throw err;
// collect all anchors (<a> elements) and print out their text and url
// in Markdown syntax
document.queryPredicateAll(function(node) {
return node.tagName == 'a';
}).forEach(function(node) {
console.log('[%s](%s)', node.textContent, node.attributes.href);
});
console.log(document.textContent);
});
var parser = new htmlparser2.Parser(handler, {decodeEntities: true});
parser.write(body);
parser.done();
});
TODO: Compare htmlfmt output with xmlformat's.
Copyright 2014-2015 Christopher Brown. MIT Licensed.
FAQs
A better DomHandler for fb55's htmlparser2
We found that domlike demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.