transform streaming html using css selectors
The cornet is a brass instrument very similar to the trumpet, distinguished by its conical bore, compact shape, and mellower tone quality. - Wikipedia
This project is demonstrating how to use a couple of my libraries to replace
substack/node-trumpet in just a couple of LOC.
Even better, there are some advantages over
fb55/htmlparser2, which is probably the fastest HTML parser currently available for node. And it's much less strict than the
saxmodule used by
MatthewMueller/cheeriomodule, you can do everything with your document that would be possible with jQuery.
var Parser = require"htmlparser2"WritableStreamCornet = require"cornet"minreq = require"minreq"$ = require"cheerio";var cornet = ;minreqget""pipecornet;cornetremove"script"; //remove all scripts//show all reposcornetselect".repo_list"$elemfind"h3"eachconsole.log"repo %d: %s" i $thistext;;;