stream html into html at a css selector
var hyperstream = require('hyperstream');
var fs = require('fs');
var hs = hyperstream({
'#a': fs.createReadStream(__dirname + '/a.html'),
'#b': fs.createReadStream(__dirname + '/b.html')
});
var rs = fs.createReadStream(__dirname + '/index.html');
rs.pipe(hs).pipe(process.stdout);
$ node example/hs.js
<html>
<body>
<div id="a"><h1>a!!!</h1></div>
<div id="b"><b>bbbbbbbbbbbbbbbbbbbbbb</b></div>
</body>
</html>
var hyperstream = require('hyperstream')
Return a duplex stream that takes an html stream as input and produces an html
stream as output, inserting the streams given by streamMap
at the css selector
keys.
If streamMap
values are strings or functions, update the contents at the css
selector key with their contents directly without using a stream.
Proxy through methods to the underlying trumpet instance.
With npm do:
npm install hyperstream
MIT