Promise.bar
Usage
Doing a bunch of tasks asynchronously with promises, and want a status indicator?
let compiles = ;Promiseallcompiles;
Simply replace Promise.all
with PromiseBar.all
, and watch a progress bar fill as compilations finish!
let PromiseBar = ;PromiseBar; PromiseBarallcompiles label: "Minify";
(Install PromiseBar via npm install --save promise.bar
)
Promise.bar
Alias as Make PromiseBar even cuter.
Promise { return PromiseBarallarguments;};
Stacked Progress Bars
Want to stack progress bars?
child = PromiseBarall label: "Child";parent = PromiseBarallchild label: "Parent";
The child will automatically be indented under the parent. Disable this for a progress bar by passing flat: false
to
PromiseBar#all
, or disable it for all progress bars with PromiseBar.conf.flat = false;
.
Color the Progress Bar
Add colors to your progress bars with libraries like Chalk.
let chalk = ; PromiseBarall label: chalk barFormat: chalkdimblue;
The label will be colored blue, and the progress bar will be light blue. You can provide any function to barFormat
to transform the output.
console.log
Content
Always Below Progress bars will always appear under other stdout
content.
All Options
Promise.bar supports much more customization than the options listed here. Please check out the full API documentation for other configurable options.