I am using gulp and would like to create a function that can be piped into that passes on the input to the output and writes a single line to the console.
For example:
this.src('/foo')
.pipe(myFunction)
.pipe(...)
Can someone help me understand what myFunction needs to look like?
The following code, stops the stream in its tracks. How can I ensure the stream data is passed onwards?
function myFunction(obj) {
var stream = new Stream.Transform({objectMode: true});
stream._transform = function () {
console.log('foo bar bam baz');
};
return stream;
}