(options, params, payload)
| 2 | const _colors = require('ansi-colors'); |
| 3 | |
| 4 | function myFormatter(options, params, payload){ |
| 5 | |
| 6 | // bar grows dynamically by current progrss - no whitespaces are added |
| 7 | const bar = options.barCompleteString.substr(0, Math.round(params.progress*options.barsize)); |
| 8 | |
| 9 | // end value reached ? |
| 10 | // change color to green when finished |
| 11 | if (params.value >= params.total){ |
| 12 | return '# ' + _colors.grey(payload.task) + ' ' + _colors.green(params.value + '/' + params.total) + ' --[' + bar + ']-- '; |
| 13 | }else{ |
| 14 | return '# ' + payload.task + ' ' + _colors.yellow(params.value + '/' + params.total) + ' --[' + bar + ']-- '; |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | function Example5(){ |
| 19 | console.log(''); |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…