Skip to content

Instantly share code, notes, and snippets.

@meatballhat
Created March 5, 2014 20:15
Show Gist options
  • Select an option

  • Save meatballhat/9375679 to your computer and use it in GitHub Desktop.

Select an option

Save meatballhat/9375679 to your computer and use it in GitHub Desktop.
/* jshint node: true */
'use strict';
var csv = require('csv');
console.log('[');
csv()
.from.path(process.argv[2], { delimiter: ',', escape: '"' })
.on('record', function (row) {
console.log(JSON.stringify(row) + ',');
})
.on('end', function () {
console.log('null]');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment