index.js
function () {
    var len = this.points.length
    
    // Check the length of the point buffer
    if (len >= options.batchSize) {  
      // Write the points and log error if any
      client.writePoints(this.points).catch(function (error) {
        console.log(error.message)
      })
      
      // Reset point buffer
      this.points = []
    }
  }
function () {
    var len = this.points.length
    
    // Check the length of the point buffer
    if (len >= options.batchSize) {  
      // Write the points and log error if any
      client.writePoints(this.points).catch(function (error) {
        console.log(error.message)
      })
      
      // Reset point buffer
      this.points = []
    }
  }
function ( ) { var len = this . points . length // Check the length of the point buffer if ( len >= options . batchSize ) { // Write the points and log error if any client . writePoints ( this . points ) . catch ( function ( error ) { console . log ( error . message ) } ) // Reset point buffer this . points = [ ] } }
When each point is added check the size of the batch and send if >= batchSize
When each point is added check the size of the batch and send if > = batchSize