code: 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 = 0;
    this.total = options.total;
    this.width = options.width || this.total;
    this.clear = options.clear
    this.chars = {
      complete   : options.complete || '=',
      incomplete : options.incomplete || '-'
    };
    this.callback = options.callback || function () {};
    this.lastDraw = '';
  }
docs: Initialize a `ProgressBar` with the given `fmt` string and `options` or
  `total`.
  
  Options:
  
  - `total` total number of ticks to complete
  - `width` the displayed width of the progress bar defaulting to total
  - `stream` the output stream defaulting to stderr
  - `complete` completion character defaulting to "="
  - `incomplete` incomplete character defaulting to "-"
  - `callback` optional function to call when the progress bar completes
  - `clear` will clear the progress bar upon termination
  
  Tokens:
  
  - `:bar` the progress bar itself
  - `:current` current tick number
  - `:total` total ticks
  - `:elapsed` time elapsed in seconds
  - `:percent` completion percentage
  - `:eta` eta in seconds
  
  @param {string} fmt
  @param {object|number} options or total
  @api public