ts-tqdm
v0.8.6
Published
A tqdm for node (Typescript).
Downloads
810
Maintainers
Readme
ts-tqdm
A tqdm for node (Typescript).
Installation
npm
npm install ts-tqdm
source
npm install https://github.com/delarco/ts-tqdm.git
Usage
Import ts-tqdm
import { tqdm } from "ts-tqdm"
Array:
for (let item of tqdm([1, 2, 3, 4, 5, 6])) {
// do stuff
}
Fixed iterations:
for (let item of tqdm(1000)) {
// do stuff
}
Example
import { tqdm } from "ts-tqdm"
const delay = (ms: number) => new Promise(resolve => setTimeout(resolve, ms));
(async () => {
for (let _ of tqdm(1000)) {
await delay(100);
}
})();