package
transform streaming html using css selectors
npm install cornetGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 10 packages.
550.9 kB
Includes dependencies.
3 direct · 3 outdated
##About
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 trumpet:
fb55/CSSselect.cornet uses fb55/htmlparser2, which is probably the fastest HTML parser currently available for node. And it's much less strict than the sax module used by trumpet.MatthewMueller/cheerio module, you can do everything with your document that would be possible with jQuery.##Example
var Parser = require("htmlparser2").WritableStream,
Cornet = require("cornet"),
minreq = require("minreq"),
$ = require("cheerio");
var cornet = new Cornet();
minreq.get("http://github.com/fb55").pipe(new Parser(cornet));
cornet.remove("script"); //remove all scripts
//show all repos
cornet.select(".repo_list", function(elem){
$(elem).