1.1.0 • Published 1 year ago

progress-txt v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago
██████╗ ██████╗  ██████╗  ██████╗ ██████╗ ███████╗███████╗███████╗   ████████╗██╗  ██╗████████╗
██╔══██╗██╔══██╗██╔═══██╗██╔════╝ ██╔══██╗██╔════╝██╔════╝██╔════╝   ╚══██╔══╝╚██╗██╔╝╚══██╔══╝
██████╔╝██████╔╝██║   ██║██║  ███╗██████╔╝█████╗  ███████╗███████╗█████╗██║    ╚███╔╝    ██║   
██╔═══╝ ██╔══██╗██║   ██║██║   ██║██╔══██╗██╔══╝  ╚════██║╚════██║╚════╝██║    ██╔██╗    ██║   
██║     ██║  ██║╚██████╔╝╚██████╔╝██║  ██║███████╗███████║███████║      ██║   ██╔╝ ██╗   ██║   
╚═╝     ╚═╝  ╚═╝ ╚═════╝  ╚═════╝ ╚═╝  ╚═╝╚══════╝╚══════╝╚══════╝      ╚═╝   ╚═╝  ╚═╝   ╚═╝   
                                                                                               

progress-txt

npm Install Size GitHub top language Snyk Vulnerabilities for npm package

A lightweight command-line tool for generating textual progress bars in various patterns, along with the corresponding progress.

This package allows you to quickly and easily calculate progress, and generate a textual progress bar in your terminal that can be shared anywhere.

Features

  • Quickly calculate the progress based on current value and total/target value.
  • Generate a textual progress bar available in following patterns:
    • default (using # and - characters)
    • block (using ▓ and ░ characters)
    • rect (using ▮ and ▯ characters)
    • fill (using ▇ and - characters)
    • pipe (using | and - characters)
  • Outputs the progress bar and percentage to the console.

Installation

Simply install progress-txt globally using npm cli tool:

npm install -g progress-txt

Usage

To use progress-txt, simply call the progress-txt generate command followed by the current value and total/target value:

progress-txt generate <currentValue> <totalValue> [options]

Example:

$ progress-txt generate 99 365
[####-----------] 27.12%

You can also use the -p or --pattern option to select different progress bar pattern:

$ progress-txt generate 17 36 --pattern block
[▓▓▓▓▓▓▓░░░░░░░░] 47.22%

$ progress-txt generate 17 36 -p rect
[▮▮▮▮▮▮▮▯▯▯▯▯▯▯▯] 47.22%

$ progress-txt generate 75 100 -p fill
[▇▇▇▇▇▇▇▇▇▇▇----] 75.00%

$ progress-txt generate 17 36 -p pipe
[|||||||--------] 47.22%

Use -s or --size option to set size of the progress bar (default: 15):

$ progress-txt generate 75 100 -s 30
[######################--------] 75.00%

For more information, use the --help option:

progress-txt --help
# or progress-txt help [command]

Example:

$ progress-txt help generate
Usage: program-txt generate [options] <currentValue> <totalValue>

Generate a textual progress bar

Arguments:
  currentValue          current value
  totalValue            total/target value (out of)

Options:
  -p, --pattern <type>  progress bar pattern (choices: "block", "rect", "fill", "pipe", "default")
  -h, --help            display help for command

Dependencies

  • commander: node.js command-line interfaces made easy

License

MIT © Kaustubh Prabhu

1.1.0

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago