const cliProgress = require('cli-progress')
const chalk = require('chalk')

/**
 * Return a progress bar w/ defaulted format.
 *
 * @param {cliProgress.Options} opts
 * @returns {cliProgress.SingleBar}
 */
function progressBar (opts) {
  return new cliProgress.SingleBar({
    format: `Upload Progress [${chalk.cyan('{bar}')}] {percentage}% || {value}/{total} Chunks || ETA: {eta}s`,
    ...opts
  })
}

module.exports = {
  progressBar
}
