Skip to content

Commit

Permalink
Merge pull request #206 from pgherveou/reporter
Browse files Browse the repository at this point in the history
Replace through2 with stream (log-reporter.js)
  • Loading branch information
pioug authored Mar 4, 2022
2 parents 6f2486c + 4a4a396 commit ad1ed30
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/log-reporter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var colors = require('ansi-colors'),
fancyLog = require('fancy-log'),
through = require('through2');
{ Transform } = require('stream');

/**
* create a log reporter
Expand All @@ -13,7 +13,8 @@ var colors = require('ansi-colors'),
module.exports = function (options) {
if (!options) options = {};

var stream = through.obj(function (file, enc, cb) {
const stream = new Transform({ objectMode: true });
stream._transform = function (file, enc, cb) {
var state;
if (!file.s3) return cb(null, file);
if (!file.s3.state) return cb(null, file);
Expand All @@ -37,7 +38,7 @@ module.exports = function (options) {

fancyLog(state, file.s3.path);
cb(null, file);
});
};

// force flowing mode
// @see http://nodejs.org/docs/latest/api/stream.html#stream_event_end
Expand Down

0 comments on commit ad1ed30

Please sign in to comment.