@anmiles/progress
TypeScript icon, indicating that this package has built-in type declarations

3.0.1 • Public • Published

@anmiles/progress

Show progress of repeating actions


Installation

npm install @anmiles/progress

Usage

Default limit = 10

import { Progress } from '@anmiles/progress';

const items = [ 'a', 'b', 'c', 'd', 'e', 'f' ];
const progress = new Progress('Processing items', items);

for (const item of items) {
	progress.tick();
}

/**
 * Processing items...
 * Processing items (1/6)...
 * Processing items (2/6)...
 * Processing items (3/6)...
 * Processing items (4/6)...
 * Processing items (5/6)...
 * Processing items (6/6)...
 */

Specified limit

import { Progress } from '@anmiles/progress';

const items = [ 'a', 'b', 'c', 'd', 'e', 'f' ];
const progress = new Progress('Processing items', items, { limit: 4 });

for (const item of items) {
	progress.tick();
}

/**
 * Processing items...
 * Processing items (1/6)...
 * Processing items (3/6)...
 * Processing items (5/6)...
 * Processing items (6/6)...
 */

Readme

Keywords

Package Sidebar

Install

npm i @anmiles/progress

Weekly Downloads

1

Version

3.0.1

License

MIT

Unpacked Size

16.7 kB

Total Files

22

Last publish

Collaborators

  • anmiles