nqdm
Simple terminal progress indicator made for any loop
Installation
npm install nqdm
Usage
With iterable objects
const nqdm = // Array, Generator, etc..const arr = ...Array1000 forconst v of // do something
Results:
4.70% [=====> ] 00:00:04 00:01:37 [1923.72 iter/sec]
Specify times of iteration instead of iterables
forconst i of // do something
Results:
4.70% [=====> ] 00:00:04 00:01:37 [1923.72 iter/sec]
Manualy process
const prgrs = whiletrue prgrs
Results:
327 [=============================================================================] 00:00:04 [2089.72 iter/sec]
Options
length
You can manually specify total length of items when you works with iterable objects without 'length' property. (Typically for generators.)
{ forlet i=0;i<num;i++ i } const g = forconst v of // do something
dest
Choose where to write progress indicator ('stdout' or 'stderr'), another value will be ignored.
Defaults to be 'stdout'.
forconst v of // now nqdm will write the progress into process.stderr
callback
You can define your own callback function being called per iteration.
const cb = { console} forconst v of // do something
silent
nqdm will display nothing when set this option to true. (designed to use with callback function.)
forconst v of // now nqdm displays nothing.