https://github.com/myterminal/faded-progressbar
A simple, light-weight and customizable progress bar for command-line applications
https://github.com/myterminal/faded-progressbar
cli nodejs progressbar
Last synced: about 2 months ago
JSON representation
A simple, light-weight and customizable progress bar for command-line applications
- Host: GitHub
- URL: https://github.com/myterminal/faded-progressbar
- Owner: myTerminal
- License: mit
- Created: 2017-02-15T05:09:06.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2022-08-19T05:14:49.000Z (almost 4 years ago)
- Last Synced: 2025-06-10T08:05:17.569Z (about 1 year ago)
- Topics: cli, nodejs, progressbar
- Language: JavaScript
- Size: 504 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# faded-progressbar
[](https://badge.fury.io/js/faded-progressbar)
[](https://www.npmjs.com/package/faded-progressbar)
[](https://opensource.org/licenses/MIT)
[](https://travis-ci.org/myTerminal/faded-progressbar)
[](https://codeclimate.com/github/myTerminal/faded-progressbar)
[](https://www.npmjs.com/package/eslint-config/myterminal)
[](https://coveralls.io/r/myTerminal/faded-progressbar?branch=master)
[](https://nodei.co/npm/faded-progressbar/)
A simple, light-weight and customizable progress bar for command-line applications

## Features
* Easy to use with only a few methods.
## How to Use
Simply do a `require` and create a process as
var fadedProgressbar = require('faded-progressbar');
var newProcess = fadedProgressbar.newProcess("Some long running process", 20);
The first argument is the process title that is to be displayed on the console, the second is the total number of sub-tasks in the process.
To print the start of the process, simply invoke `start()`.
newProcess.start();
When the process progresses (in small steps), invoke `updateProgress()` passing in the new progress number.
newProcess.updateProgress(15);
When the process ends, invoke `end()` which prints *100%* against the process title and shows a completed progress bar.
newProcess.end();
You are free to use the console to print any logs while a process is active, *faded-progressbar* takes care of maintaining a single progress bar at the end of the console automatically.
By default, the package replaces the default `console.log()` method with an internal one, which is almost the same but with a few extra functionalities. You can turn this feature off by invoking `unmaskLogs()`.
fadedProgressbar.unmaskLogs();
Once turned off, you would be able to use the default `console.log()` again. This should not be required in usual cases though.
You can also enable the feature with the exact opposite method: `maskLogs()`.
## To-do
* Customizable progress bar character
* Animations