Skip to content

Instantly share code, notes, and snippets.

@rapodaca
Created September 10, 2013 23:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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