0.1.1 • Published 8 years ago

progrescii v0.1.1

Weekly downloads
5
License
MIT
Repository
github
Last release
8 years ago

progrescii

npm GitHub license

NodeJS easy graphical progress bars for the terminal/console.

Getting Started

Installation

npm install progrescii

Usage

Simple instance creation with default style:

'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:

Loading ▪▪▪▪▪▪▪▪▪▪▫▫▫▫▫▫▫▫▫▫ 50% in 0.51s

Customize

Configure template size and style:

'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:

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:

'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:

Retrieving Information [================== ] 91% in 0.51s
0.1.1

8 years ago

0.1.0

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago