docs: function onData(W) {
          var buffer = getBuffer(W),
              full = false,
              dropVal,
              sum = 0,
              delta = 0,
              N = 0;
  
          /**
          * FUNCTION: onData(newVal, encoding, clbk)
          *   Data event handler. Calculates the moving sum.
          *
          * @private
          * @param {Number} newVal - streamed data value
          * @param {String} encoding
          * @param {Function} clbk - callback to invoke after finding a sum. Function accepts two arguments: [ error, chunk ].
          */
          return function onData(newVal, encoding, clbk) {
              // Fill buffer of size W
              if (!full) {
                  buffer[N] = newVal;
  
                  sum += newVal;
                  N += 1;
  
                  if (N===W) {
                      full = true;
                      this.push(sum);
                  }
                  clbk();
                  return;
              }
  
              // Update buffer: (drop old value, add new)
              dropVal = buffer.shift();
              buffer.push(newVal);
  
              // Calculate moving sum:
              delta = newVal - dropVal;
              sum += delta;
  
              clbk(null, sum);
          }; // end FUNCTION onData(newVal)
      }