https://github.com/willyelm/progrescii
NodeJS easy graphical progress bars for the terminal.
https://github.com/willyelm/progrescii
Last synced: 13 days ago
JSON representation
NodeJS easy graphical progress bars for the terminal.
- Host: GitHub
- URL: https://github.com/willyelm/progrescii
- Owner: willyelm
- License: mit
- Created: 2016-03-17T00:33:24.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-07-26T13:27:13.000Z (almost 9 years ago)
- Last Synced: 2025-05-16T15:18:03.804Z (about 2 months ago)
- Language: JavaScript
- Size: 12.7 KB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# progrescii
[](https://www.npmjs.com/package/progrescii)
[](https://github.com/willyelm/progrescii)NodeJS easy graphical progress bars for the terminal/console.
## Getting Started
## Installation
```bash
npm install progrescii
```## Usage
Simple instance creation with default style:
```javascript
'use strict'
const Progress = require('progrescii')
// Create a instance and render the progress bar
var p = Progress.create({
total: 100
})// Add to the total percentage so far
p.step(50)// Set the total percentage so far
p.set(75)```
Output Example:
```bash
Loading ▪▪▪▪▪▪▪▪▪▪▫▫▫▫▫▫▫▫▫▫ 50% in 0.51s
```## Customize
Configure template size and style:
```javascript
'use strict'
const Progress = require('progrescii')
var p = Progress.create({
size: 20,
total: 40,
pending: '░',
complete: '█',
template: 'Downloading :b :p% in :ts'
// Template Text tokens:
//:b progress bar text
//:p percentage Number
//:t execution time
})// Update the total percentage
p.step(20)
```Output Example:
```bash
Downloading █████░░░░░░░░░░░░░░░ 25% in 0.00s
```## Global Customization
To use the same configuration every time we create a instance
of the bar we can configure it as following:```javascript
'use strict'
const Progress = require('progrescii')
// Global configuration
Progress.config({
template: 'Retrieving Information [:b] :p% in :ts',
pending: ' ',
complete: '=',
size: 20
})
// Create and update instance
Progress
.create({
total: 11
})
.step(10);
```Output Example:
```bash
Retrieving Information [================== ] 91% in 0.51s
```