/**
 * Generate a progress bar
 *
 * @param {number} [percentage = 0] Percentage (out of 100)
 * @param {number} [totalSteps = 10] Number of characters
 * @param {string} [complete = "█"] Character (completed)
 * @param {string} [empty = "▒"] Character (empty)
 * @return {string} bar
 *
 * @example
 * var snu = require('s-node-utils');
 *
 * snu.others.progressBar(5, 10);
 * //=> █████▒▒▒▒▒
 *
 * snu.others.progressBar(44, 50, '!', '|');
 * //=> !!!!!!!!!!!!!!!!!!!!!!||||||||||||||||||||||||||||
 */
module.exports = function(
  percentage = 0,
  totalSteps = 10,
  complete = '█',
  empty = '▒'
) {
  var progress = Math.round(
    ((percentage > 100 ? 100 : percentage) / 100) * totalSteps
  );
  var com = complete.repeat(progress);
  var emp = empty.repeat(totalSteps - progress);
  return com + emp;
};
