Skip to content

Instantly share code, notes, and snippets.

@rapodaca
Created September 10, 2013 23:52
Show Gist options
  • Save rapodaca/6517428 to your computer and use it in GitHub Desktop.
Save rapodaca/6517428 to your computer and use it in GitHub Desktop.
var CSV = require('csv');
CSV()
.from.string('foo\nbar\nbaz')
.on('record', function(row, index) {
if (index === 2) {
this.error(new Error('stop'));
}
})
.on('error', function(err) {
console.log(err);
})
.on('end', function(count) {
console.log('end');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment