Monday, 10 April 2017

Javascript stopping an event

is it possible at all to stop and event and force to go to the end.

string rows // Correctly formatted csv string.

csv
  .fromString(rows, { headers: false })
  .on('data', (data) => {
    if (condition) {
       // force to end.
    }
  }
  .on('end', () => cb(units));

I am therefore looking to break out of the csv file early.



via Tyler Evans

No comments:

Post a Comment