node-supervisor icon indicating copy to clipboard operation
node-supervisor copied to clipboard

Unable to pipe output to something else

Open binarykitchen opened this issue 10 years ago • 4 comments

Hello there

I'd like to pipe the output with a tool util like https://github.com/pwmckenna/grunt-bunyan with a command like this:

node server.js | ./node_modules/bunyan/bin/bunyan

so that bunyan's log is pretty printed. Looks like this is not supported, so, sorry to ask but I think we need a new parameter pipeTo here to make this work.

I also tried to fix this in my gulp file but no success. Something like:

gulp.task('supervisor', function() {
    supervisor(..., {
        extensions: ['js', 'json'],
    }).pipe(exec(' | ./node_modules/bunyan/bin/bunyan'));
});

wont work.

binarykitchen avatar May 29 '14 08:05 binarykitchen

Another solution would be a new parameter to pipe out the output. Just a stream we can redirect to anywhere, i.E. to another gulp plugin.

binarykitchen avatar May 29 '14 09:05 binarykitchen

Okay, I think I see what you mean. Supervisor's own output gets piped, but the output of the child process doesn't. Is that what you're seeing too?

iangreenleaf avatar Jun 10 '14 18:06 iangreenleaf

@iangreenleaf Right man, that's the issue here

binarykitchen avatar Jun 10 '14 23:06 binarykitchen

Workaround: Just output log to some file for example app.error.json then use command:

tail -f -n100 ./app.error.json | bunyan

anhhh11 avatar Feb 15 '16 14:02 anhhh11