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

Can I get example for providing option 'stream' in creation of progress bar

Open mindfireon812 opened this issue 10 years ago • 3 comments

mindfireon812 avatar Mar 12 '15 10:03 mindfireon812

# bar.coffee
ProgressBar = require 'progress'

bar = new ProgressBar ':bar',
    total  : 10
    stream : process.stderr

timer = setInterval ->
    bar.tick()

    if bar.complete
        console.error '\ncomplete\n'
        clearInterval timer
, 100

coffee bar.coffee 2> /dev/null will hide the processbar and the message because I redirect the stderr output to /dev/null. By default, the script uses the stderr output but you could also use the stdin (default output on terminal).

bar = new ProgressBar ':bar',
    total  : 10
    stream : process.stdout

cmizzi avatar Mar 12 '15 16:03 cmizzi

@mindfireon812

Did @cmizzi advice help you?

hallas avatar Apr 30 '15 07:04 hallas

Up to some extent.

mindfireon812 avatar May 01 '15 04:05 mindfireon812