3.0.1 • Published 1 year ago

@anmiles/progress v3.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@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)...
 */
3.0.1

1 year ago

3.0.0

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

2 years ago

1.0.0

2 years ago