All Projects → bubkoo → Ascii Progress

bubkoo / Ascii Progress

Licence: mit
🍓 Ascii progress-bar(s) in the terminal.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Ascii Progress

Go Pretty
Pretty print tables and more in golang!
Stars: ✭ 777 (+365.27%)
Mutual labels:  ascii, progress-bar
Vue Wait
Complex Loader and Progress Management for Vue/Vuex and Nuxt Applications
Stars: ✭ 1,869 (+1019.16%)
Mutual labels:  progress, progress-bar
Roundprogresstextview
TextView with Round Pogress
Stars: ✭ 18 (-89.22%)
Mutual labels:  progress, progress-bar
Ng2 Slim Loading Bar
Angular 2 component shows slim loading bar at the top of the page.
Stars: ✭ 376 (+125.15%)
Mutual labels:  progress, progress-bar
Terminal layout
The project help you to quickly build layouts in terminal,cross-platform(一个跨平台的命令行ui布局工具)
Stars: ✭ 98 (-41.32%)
Mutual labels:  progress, progress-bar
Multiprogressview
📊 An animatable view that depicts multiple progresses over time. Modeled after UIProgressView
Stars: ✭ 614 (+267.66%)
Mutual labels:  progress, progress-bar
Radialprogressbar
Radial ProgressBar inspired by Apple Watch OS. It is highly Customisable
Stars: ✭ 141 (-15.57%)
Mutual labels:  progress, progress-bar
VHProgressBar
Vartical and Horizontal ProgressBar
Stars: ✭ 23 (-86.23%)
Mutual labels:  progress, progress-bar
Delayedprogress
ProgressDialog that waits a minimum time to be dismissed before showing. Once visible, the ProgressDialog will be visible for a minimum amount of time to avoid "flashes" in the UI.
Stars: ✭ 95 (-43.11%)
Mutual labels:  progress, progress-bar
Node Status
Nodejs stdout status and progress bar. Multi-item, various display types.
Stars: ✭ 71 (-57.49%)
Mutual labels:  progress, progress-bar
Tqdm
A Fast, Extensible Progress Bar for Python and CLI
Stars: ✭ 20,632 (+12254.49%)
Mutual labels:  progress, progress-bar
Jocircularslider
A highly customisable and reusable circular slider for iOS applications.
Stars: ✭ 128 (-23.35%)
Mutual labels:  progress, progress-bar
Qier Progress
💃 Look at me, I am a slim progress bar and very colorful / 支持彩色或单色的顶部进度条
Stars: ✭ 307 (+83.83%)
Mutual labels:  progress, progress-bar
Python Progressbar
Progressbar 2 - A progress bar for Python 2 and Python 3 - "pip install progressbar2"
Stars: ✭ 682 (+308.38%)
Mutual labels:  progress, progress-bar
Topbar
Tiny & beautiful site-wide progress indicator
Stars: ✭ 262 (+56.89%)
Mutual labels:  progress, progress-bar
Vue Step Progress
A simple Vue component that displays a Progress Bar with labels for each step
Stars: ✭ 26 (-84.43%)
Mutual labels:  progress, progress-bar
angular-progress-bar
This component allow you to easy incorporate progress-bar to angular/ionic project, providing binding and color options
Stars: ✭ 26 (-84.43%)
Mutual labels:  progress, progress-bar
LineProgressbar
A light weight jquery progressbar plugin
Stars: ✭ 34 (-79.64%)
Mutual labels:  progress, progress-bar
Mkringprogressview
⭕️ Ring progress view similar to Activity app on Apple Watch
Stars: ✭ 1,140 (+582.63%)
Mutual labels:  progress, progress-bar
Ruby Progressbar
Ruby/ProgressBar is a text progress bar library for Ruby.
Stars: ✭ 1,378 (+725.15%)
Mutual labels:  progress, progress-bar

ascii-progress

Ascii progress-bar(s) in the terminal.

MIT License Package Quality

Feature:

  • Support multi progress-bars
  • Relative and absolute with
  • Colorful bar and text
  • Highly customizable

snapshot

Install

$ npm install ascii-progress

Usage

For more usage see the examples

var ProgressBar = require('ascii-progress');

var bar = new ProgressBar({ 
    schema: ':bar',
    total : 10 
});

var iv = setInterval(function () {
  bar.tick();
  if (bar.completed) {
    clearInterval(iv);
  }
}, 100);

Options

These are keys in the options object you can pass to the progress bar along with total as seen in the example above.

  • schema - template string of the progress bar. Default " [:bar] :current/:total :percent :elapseds :etas'".
  • total - total number of ticks to complete. Default 100.
  • current- number of completed ticks. Default 0.
  • width - display width, percentage or less than 1 is relative the terminal's width. Default 60.
  • fixedWidth - do not adjust the bar based on the terminal size
  • filled- completion character. Default "▇".
  • blank - blank character. Default "-".
  • clean - clear the progress bar on completion. Default false.
  • callback - optional function to call when the progress bar completes.

Properties

  • schema
  • total
  • current
  • completed

Methods

setSchema(schema, refresh/tokens)

Update the schema of the progress bar. If refresh or tokens is truely the progress bar will be refreshed.

tick(delta, tokens)

Update ticks of the progress bar by delta, then render the progress bar with optional tokens.

update(ratio, tokens)

Update the progress bar to ratio by percentage, then render the progress bar with optional tokens.

clear()

Clean the progress bar in the terminal.

Schema

The schema defines appearance the progress bar. Few inner tokens and many formatting methods can be used to customer you progress bar.

Tokens

These are tokens you can use in the format of your progress bar.

  • :filled Completed part of the progress bar.
  • :blank Blank part of the progress bar.
  • :bar Whole progress bar, equal to :completed:blank.
  • :current Current tick number.
  • :total Total ticks.
  • :percent Completion percentage.
  • :elapsed Time elapsed in seconds.
  • :eta Estimated completion time in seconds.

Custom Tokens

You can define custom tokens by adding a {name: value} object parameter to your method (tick(), update(), etc.) calls.

var bar = new ProgressBar({
    schema: ':current: :token1 :token2',
    total : 3 
});
bar.tick({
  'token1': "Hello",
  'token2': "World!"
})
bar.tick(2, {
  'token1': "Goodbye",
  'token2': "World!"
})

The above example would result in the output below.

1: Hello World!
3: Goodbye World!

Colors

Color names can be use in schema:

:bar.red :percent.green

Then the progress bar will be red, and the percentage will be green.

All available color names:

  • red
  • cyan
  • blue
  • grey
  • white
  • black
  • green
  • yellow
  • magenta
  • brightRed
  • brightBlue
  • brightCyan
  • brightWhite
  • brightBlack
  • brightGreen
  • brightYellow
  • brightMagenta

And with the bg prefix, such as bgRed, the color will be applied to the background.

:bar.red.bgBlue

The above progress bar has blue background and red foreground.

Gradient

:bar.gradient(red,blue)

The arguments can be color names or hex color:

  • red
  • cyan
  • blue
  • grey
  • white
  • black
  • green
  • yellow
  • magenta
  • #xxxxxx

Font style

Same as color names, font style can also be assigned by name:

  • bold
  • italic
  • inverse
  • underline
:bar.red :percent.green.bold

The percentage is green and bold.

Contributing

Pull requests and stars are highly welcome.

For bugs and feature requests, please create an issue.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].