heroku-kafka
Version:
heroku plugin to manage heroku kafka
14 lines (13 loc) • 436 B
JavaScript
import { color } from '@heroku/heroku-cli-util';
export default function (current, total, width = 10) {
let percentage = current / total;
if (percentage > 1)
percentage = 1;
if (percentage < 0)
percentage = 0;
const filled = Math.floor(percentage * width);
const empty = width - filled;
let output = color.blue('█'.repeat(filled));
output += '·'.repeat(empty);
return `[${output}]`;
}