docs: function ProgressBar(fmt, options) {
    this.stream = options.stream || process.stderr
  
    if (typeof options == 'number') {
      var total = options
      options = {}
      options.total = total
    } else {
      options = options || {}
      if ('string' != typeof fmt) throw new Error('format required')
      if ('number' != typeof options.total) throw new Error('total required')
    }
  
    this.fmt = fmt
    this.curr = options.curr || 0
    this.total = options.total
    this.width = options.width || this.total
    // to have offset at the right of the progress bar
    this.offset = options.offset
    this.clear = options.clear
    this.chars = {
      complete: options.complete || '=',
      incomplete: options.incomplete || '-',
      head: options.head || (options.complete || '=')
    }
    this.renderThrottle =
      options.renderThrottle !== 0 ? options.renderThrottle || 16 : 0
    this.lastRender = -Infinity
    this.callback = options.callback || function() {}
    this.tokens = {}
    this.lastDraw = ''
  }