Socket
Socket
Sign inDemoInstall

cli-progress-bar

Package Overview
Dependencies
9
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cli-progress-bar

A simple CLI progress bar, inspired by Gauge


Version published
Weekly downloads
338
increased by88.83%
Maintainers
1
Install size
63.6 kB
Created
Weekly downloads
 

Readme

Source

Usage

A simple CLI progress bar, inspired by Gauge.

var ProgressBar = require('cli-progress-bar')

var bar = new ProgressBar()

bar.show("Foo", 0.75)

bar.pulse("bar")

bar.hide()

screenshot 2015-10-15 02 58 33

API

var bar = new ProgressBar([options])

  • options(optional) An option object.

The options object can have the following properties, all of which are optional:

  • theme: defaults to ProgressBar.themes.unicode if the terminal supports unicode according to [cli-character-set], otherwise it defaults to ProgressBar.themes.ascii or ProgressBar.themes.cp437 for Windows.
  • width: sets a desired width (in columns) of the entire progress indicator, not just the bar. The progress bar itself will take up about half of the column width. Additional text may overflow the desired with. By default it uses the number of available columns of the TTY.

bar.show([name, [completed]])

  • name(optional) The name of the current thing contributing to progress. Defaults to the last value used, or "".
  • completed(optional) The portion completed as a value between 0 and 1. Defaults to the last value used, or 0.

bar.hide()

Removes the progress bar from the terminal.

bar.pulse([name])

  • name(optional) The specific thing that triggered this pulse

Spins the spinner in the progress bar to show output. If name is included then it will be combined with the last name passed to bar.show() using the subsection property of the theme (typically a right facing arrow).

Keywords

FAQs

Last updated on 06 Sep 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc