Skip to content

Commit

Permalink
Change csv dependency to use an npm-available parser
Browse files Browse the repository at this point in the history
  • Loading branch information
kiara-riley authored and Kraig McKernan committed Sep 15, 2016
1 parent 59d61ce commit 035f9ad
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions bin/sifter.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var fs = require('fs');
var optimist = require('optimist');
var cardinal = require('cardinal');
var async = require('async');
var csv = require('node-csv');
var csv = require('csv-parse');
var Stream = require('stream');
var humanize = require('humanize');
var Sifter = require('../lib/sifter');
Expand Down Expand Up @@ -98,11 +98,13 @@ var step_parse = function(callback) {

// csv
data = [];
csv.parse(raw, {headers: true}, function(line) {
if (Array.isArray(line)) return;
data.push(line);
csv(raw, {columns: true}, function(err, parsed) {
parsed.forEach(function(line) {
if (Array.isArray(line)) return;
data.push(line);
});
callback();
});
callback();
};

/**
Expand Down Expand Up @@ -161,4 +163,4 @@ async.series([
], function(err) {
if (err) console.error(err);
process.exit(err ? 1 : 0);
});
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"cardinal": "0.4.x",
"async": "0.2.x",
"humanize": "0.0.x",
"node-csv": "git://github.com/voodootikigod/node-csv"
"csv-parse": "^1.1.7"
},
"devDependencies": {
"mocha": "1.12.x",
Expand Down

0 comments on commit 035f9ad

Please sign in to comment.