Comparing version 0.3.12 to 0.3.13
@@ -31,4 +31,5 @@ module.exports = csvAdv; | ||
this.resultObject = new Result(); | ||
if (this.param.constructResult) { | ||
this.pipe(this.resultObject); | ||
this.pipe(this.resultObject); | ||
if (!this.param.constructResult) { | ||
this.resultObject.disableConstruct(); | ||
} | ||
@@ -35,0 +36,0 @@ this.headRow = []; |
@@ -21,1 +21,7 @@ module.exports=Result; | ||
} | ||
Result.prototype.disableConstruct=function(){ | ||
this._write=function(d,e,cb){ | ||
cb();//do nothing just dropit | ||
} | ||
} |
@@ -15,3 +15,3 @@ { | ||
}], | ||
"version": "0.3.12", | ||
"version": "0.3.13", | ||
"keywords": [ | ||
@@ -18,0 +18,0 @@ "csv", |
@@ -169,2 +169,18 @@ var CSVAdv = require("../libs/core/csvConverter.js"); | ||
}); | ||
it ("shoudl parse large csv file",function(done){ | ||
var testData=__dirname+"/data/large-csv-sample.csv"; | ||
var rs=fs.createReadStream(testData); | ||
var csvConverter=new CSVAdv({ | ||
constructResult:false | ||
}); | ||
var count=0; | ||
csvConverter.on("record_parsed",function(d){ | ||
count++; | ||
}); | ||
csvConverter.on("end_parsed",function(){ | ||
assert(count===5290); | ||
done(); | ||
}); | ||
rs.pipe(csvConverter); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
131673
32
887