Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anmiles/progress
Show progress of repeating actions
https://github.com/anmiles/progress
console javascript jest library nodejs progress typescript
Last synced: 8 days ago
JSON representation
Show progress of repeating actions
- Host: GitHub
- URL: https://github.com/anmiles/progress
- Owner: anmiles
- License: mit
- Created: 2024-01-30T20:11:13.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-03-20T11:23:52.000Z (7 months ago)
- Last Synced: 2024-09-21T18:11:34.510Z (12 days ago)
- Topics: console, javascript, jest, library, nodejs, progress, typescript
- Language: TypeScript
- Homepage:
- Size: 710 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# @anmiles/progress
Show progress of repeating actions
----
## Installation
`npm install @anmiles/progress`
## Usage
### Default limit = 10
```js
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
```js
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)...
*/
```