node-progress
node-progress copied to clipboard
Upgrading to 2.0 causes bar to not display until final tick
I have an app with a progress bar. Works fine with 1.1.8. When upgrading to 2.0.0, nothing displays until the final tick, which makes a progress bar pretty useless! I added a console.log()
statement after the tick
method and it does log that our at the appropriate time.
Using node 6.8.0 in a script run with npm.
Bar source:
const bar = new ProgressBar('Parsing: [:bar] :file (:current/:total)',
{total: paths.length, width: 20, complete: '#', incomplete: ' '});
// ... (Within loop)
bar.tick({file: componentDirectory});
console.log('tick');
Output:
tick
tick
tick
Parsing: [####################] ui/ViewManager (79/79)
tick
I have the same problem, my application has a lot of synchronous processing, so the setTimeout callback is not triggered until the end of processing.
Can we add a feature, if option renderThrottle
= 0 is sent to the constructor, then call render() directly instead of using setTimeout?
I added bar.render()
after each bar.tick()
and it "fixed" this.
Merged a "fix". I need to test a bit before releasing
I'm having this issue, is there an alternative to .render() aftear each tick?