Through stream that logs to console everything that passes through it.
Through stream that logs to console everything that passes through it. Use it as a quick debuuging tool by inserting in at a right point of a pipeline to see what is passing through.
Let say that you have the following pipeline
var spawn = require'child_process'spawnchild = require'event-stream'childfiled = require'filed';filed'/etc/passwd'pipechildspawn'grep''odysseas'pipechildspawn'wc' '-l';
and you are wondering what is being piped through the
grep process to the
wc - and do so without affecting the rest of the program. You can do :
var throughLogged = require'through-logged';filed'/etc/passwd'pipechildspawn'grep''odysseas'pipethroughLogged // we inserted the logger here.pipechildspawn'wc' '-l';
which will print to the output the greped lines - before passed to wc.
The code of this module is tiny:
var tee = require'tee-1'consoleStream = require'console-stream';return teeconsoleStream;moduleexports = throughLogged;
npm install through-logged