cli-progress-box
Quick visual change detection indicator
Easy to use
Usage
var opts = padding: 2 maxStep: 8 width: 3 var box = opts optscharacter = '愛'
output
About
A visual CLI change/progress indicator
Why
When you save a file and your watcher rebuilds your project it is sometimes hard to see that anything has changed because the output from the watch process is so similar to the previous output.
For who?
CLI applications.
How
API
var progressBox = var opts = {} // state object ( mutates )var box = // create new progress box box // alias for box()box // shorthand for `box.clc.reset + box.tick()` boxclc // embedded `medikoo/cli-color` object boxbgColorsdark // list of `medikoo/cli-color` bacground colorsboxbgColorsbright // list of bright `medikoo/cli-color` background colorsboxbgColorsall // both lists boxfgColorsdark // list of `medikoo/cli-color` bacground colorsboxfgColorsbright // list of bright `medikoo/cli-color` background colorsboxfgColorsall // both lists
Options / Initial State
opts = opts || {}
if ( !opts.step ) opts.step = 0
if ( !opts.maxStep ) opts.maxStep = 4
if ( !opts.offset ) opts.offset = 0
if ( !opts.width ) opts.width = 2
if ( !opts.stepSize ) opts.stepSize = opts.stepSize
if ( !opts.padding ) opts.padding = 0
if ( !opts.margin ) opts.margin = 4
if ( !opts.character ) opts.character = ' '
if ( !opts.colors ) opts.colors = clcBgColors.bright.slice() // color changes based on opts.step
if ( !opts.getHeader ) opts.getHeader = function ( opts ) { return '' }
if ( !opts.getFooter ) opts.getFooter = function ( opts ) { return '' }
if ( !opts.transform ) opts.transform = _transform
if ( !opts.render ) opts.render = _render
if ( !opts.generateBox ) opts.generateBox = _generateBox
Alternatives
Test
npm test