Guest User

Untitled

a guest
Jan 16th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. const merge = require('merge-stream');
  2.  
  3. const stream = merge();
  4.  
  5. configs.forEach(conf => {
  6. stream.add(exec(conf.input));
  7. // exec is essentially pipes vfs.src() through custom plugin
  8. });
  9.  
  10. stream.pipe(through2.obj((file, encoding, cb) => {
  11. if (!file.isNull()) {
  12. const relativePath = file.path.replace(process.cwd() + '/', '');
  13.  
  14. process.stdout.cursorTo(0);
  15. process.stdout.write(chalk.green(`Writing ${relativePath}`));
  16. process.stdout.clearLine(1);
  17. }
  18.  
  19. cb();
  20. }));
Add Comment
Please, Sign In to add comment