bench.js 310 B

1234567891011121314
  1. var fs = require('fs')
  2. var csv = require('./')
  3. var now = Date.now()
  4. var rows = 0
  5. fs.createReadStream(process.argv[2] || '/tmp/tmp.csv')
  6. .pipe(csv())
  7. .on('data', function (line) {
  8. rows++
  9. })
  10. .on('end', function () {
  11. console.log('parsed ' + rows + ' rows in ' + (Date.now() - now) + ' ms')
  12. })