code: function TokenBucket(timespan, limit, { distFactor = 1, factor = 20, spread = 500 / timespan, now = Date.now } = {}) {
    this.now = now;
  
    this.timespan = timespan;
    // this.givenLimit is the limit given to the constructor, this.limit is the
    // functional limit, accounting for this.distFactor.
    this.givenLimit = limit;
    this.factor = factor;
    this.spread = spread;
    this.timespanIndex = Math.ceil(timespan / factor);
    this.total = 0;
    this.time = -1;
    this.buffer = new Array(this.factor + 1).fill(0);
  
    this.setDistFactor(distFactor);
  }
docs: Token bucket. Represents a single "100:60", AKA a 100 tokens per 60 seconds pair.