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

fast-csv

Package Overview
Dependencies
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fast-csv - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

17

lib/formatter.js
var fs = require("fs"),
extended = require("./extended"),
isUndefinedOrNull = extended.isUndefinedOrNull,
hash = extended.hash,

@@ -32,7 +33,9 @@ stream = require("stream"),

return function escapeFields(fields) {
var i = -1, l = fields.length, ret = [];
var i = -1, l = fields.length, ret = [], field;
while (++i < l) {
ret.push(escapeField(fields[i]));
field = fields[i];
field = (isUndefinedOrNull(field) ? "" : field) + "";
ret.push(escapeField(field));
}
return ret.join(delimiter) + LINE_BREAK;
return ret.join(delimiter);
};

@@ -63,3 +66,3 @@ }

}
writer.push(ret.join(""));
writer.push(ret.join("\n"));
}

@@ -76,7 +79,3 @@ }

function writeToStream(ws, arr, options) {
var writer = new stream.Readable();
__write(writer, arr, options);
writer.push(null);
writer.pipe(ws);
return writer;
return write(arr, options).pipe(ws);
}

@@ -83,0 +82,0 @@

@@ -39,6 +39,25 @@ var extended = require("./extended"),

var origOn = ParserStream.prototype.on;
var origOn = ParserStream.prototype.on,
origPause = ParserStream.prototype.pause,
origResume = ParserStream.prototype.resume;
function pause() {
origPause.apply(this, arguments);
this.paused = true;
this.pause = pause;
}
function resume() {
origResume.apply(this, arguments);
this.paused = false;
if (this.__pausedDone) {
this.__pausedDone();
}
this.resume = resume;
}
extended(ParserStream).extend({
__pausedDone: null,
__parseLine: function __parseLineData(data, index, ignore) {

@@ -115,3 +134,7 @@ var ignoreEmpty = this._ignoreEmpty;

}
done();
if (!this.paused) {
done();
} else {
this.__pausedDone = done;
}
},

@@ -132,2 +155,21 @@

pause: function () {
if (!this.paused) {
this.paused = true;
this.emit("pause");
}
},
resume: function () {
if (this.paused) {
this.paused = false;
if (this.__pausedDone) {
var done = this.__pausedDone;
this.__pausedDone = null;
done();
}
this.emit("resume");
}
},
on: function (evt) {

@@ -134,0 +176,0 @@ if (evt === "data" || evt === "readable") {

{
"name": "fast-csv",
"version": "0.1.1",
"version": "0.1.2",
"description": "CSV parser for node.js",

@@ -5,0 +5,0 @@ "main": "index.js",

Sorry, the diff of this file is not supported yet

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