panto-stream
v0.7.8
Published
Stream for panto
Downloads
6
Readme
panto-stream
Stream for panto.
v0.7.0
breaking change: clearCache is removed.
/**
🚴read(.js)------►filter(src/*.js)-------►babel--------
| |
| |
| |
| ▼
|------------►filter(3rd/*.js)----------------►uglify
| |
| |
| |
| ▼
| 🏅write◄--------uglify◄--------browserify
| |
| |
| |
| ▼
filter(.html)--------------------►replace---------🎖write
*/
const PantoStream = ('panto-stream');
const origin = new PantoStream();
const read = new ReadTransformer();
const babel = new BabelTransformer();
const browserify = new BrowserifyTransformer();
const uglify = new UglifyTransformer();
const replace = new ReplaceTransformer();
const write = new WriteTransformer();
const filter = function(pattner) {
return new FilterTransformer(pattern)
};
origin.pipe(read);
read.pipe(filter('src/*.js')).pipe(babel).pipe(browserify);
read.pipe(filter('3rd/*.js')).pipe(browserify)
read.pipe(filter('*.html')).pipe(replace);
browserify.pipe(uglify).pipe(write);
uglify.pipe(replace, false).pipe(write)
origin.freeze().flow([{filename, content}, {filename, content}]).then(files => {});
API
- constructor(transformer)
- tag(string)
- connect(stream, mergeFiles)
- pipe(transformer, mergeFiles)
- notify(...files)
- freeze()
- reset()
- flow(files)
- isConnectedWith(stream)