Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

csvtojson

Package Overview
Dependencies
Maintainers
1
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

csvtojson - npm Package Compare versions

Comparing version 0.3.12 to 0.3.13

test/data/large-csv-sample.csv

5

libs/core/csvConverter.js

@@ -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
}
}

2

package.json

@@ -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);
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc