code: 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 = []
      }
    }
docs: When each point is added check the size of the batch and send if >= batchSize