cornet
cornet copied to clipboard
Question: A simple trumped equivalent example
Hello, thanks for write this library, it's small and easy to use.
Can you provide a trumpet
example equivalent in order to modify a specific matched selector and write the output?
var trumpet = require('trumpet');
var tr = trumpet();
tr.pipe(process.stdout);
var ws = tr.select('tbody').createWriteStream();
ws.end('<tr><td>rawr</td></tr>');
var fs = require('fs');
fs.createReadStream(__dirname + '/html/table.html').pipe(tr);
Particularly, in my case, I want to rewrite some things from an original HTML, like convert image src into absolute URLs.