style-stream
v1.3.0
Published
Transform stream that reads HTML and writes all (inline and referenced) CSS used in it.
Downloads
16
Maintainers
Readme
style-stream
Transform stream that reads HTML and writes all (inline and referenced) CSS used in it.
Usage
style-stream http://npmjs.org/package/example
or
curl http://github.com/iojs | style-stream http://github.com
var request = require('request'),
styles = require('style-stream');
styles({url: 'http://npmjs.org/package/example'}))
.pipe(process.stdout);
// or
request('http://npmjs.org/package/example')
.pipe(styles({baseurl: 'http://npmjs.org/package/example'}))
.pipe(process.stdout);
or
var fs = require('fs'),
styles = require('style-stream');
fs.createReadStream(__dirname + '/index.html')
.pipe(styles({basepath: __dirname}))
.pipe(process.stdout);