precisebar is a low-level precise text-based progress bar for use in command-line applications.
Where most text-based progress bars use ascii characters, precisebar takes advantage of widespread unicode support to render sub-character lengths.
Why use precisebar?
- precisebar allows for smaller progress bars
- precisebar allows for highly precise progress information
- precisebar only has one dependency, chalk
Installation
yarn install precisebar
Usage
Basic usage:
const bar = ;const progress = 03; // Any number 0-1const charWidth = 15; // Any integer valueconsole;
Advanced usage:
const bar = ;const progress = 03;const charWidth = 15;const beginningColor = "cyan";const endColor = "bgGrey";console;
Valid beginning colors:
- black
- red
- green
- yellow
- blue
- magenta
- cyan
- white
- blackBright (alias: gray, grey)
- redBright
- greenBright
- yellowBright
- blueBright
- magentaBright
- cyanBright
- whiteBright
- Any RGB array (ex: [255, 105, 180])
Valid end colors:
- bgBlack
- bgRed
- bgGreen
- bgYellow
- bgBlue
- bgMagenta
- bgCyan
- bgWhite
- bgBlackBright (alias: bgGray, bgGrey)
- bgRedBright
- bgGreenBright
- bgYellowBright
- bgBlueBright
- bgMagentaBright
- bgCyanBright
- bgWhiteBright
- Any RGB array (ex: [248, 248, 255])
License
Blue Oak License v1.0.0 - A modern alternative to the MIT License.