This commit is contained in:
2017-12-22 17:10:46 +03:00
parent 6345ddcd19
commit 0dd878224b
14 changed files with 88 additions and 136 deletions

View File

@@ -1,26 +0,0 @@
'use strict';
const through = require('through2');
const gutil = require('gulp-util');
const col = gutil.colors;
const Tail = require('tail').Tail;
module.exports = (handler) => {
let stream = null;
let tail = null;
const bufferContents = (file, enc, callback) => {
tail = new Tail(file.path);
tail.on("line", handler);
callback();
};
const endStream = (callback) => {
if (tail) {
tail.unwatch();
tail = null;
}
callback();
};
return stream = through.obj(bufferContents, endStream);
};