New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

csv-streamify

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

csv-streamify - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

33

csv-streamify.js

@@ -15,3 +15,7 @@ var Transform = require('stream').Transform,

module.exports = function (opts, cb) { return new CSVStream(opts, cb) }
module.exports = function (opts, cb) {
var s = new CSVStream(opts, cb)
if (typeof cb === 'function') s.on('error', cb)
return s
}

@@ -39,6 +43,4 @@ module.exports.CSVStream = CSVStream

this.quote = opts.quote || '\"'
this.empty = ''
this.empty = opts.hasOwnProperty('empty') ? opts.empty : ''
if (opts.hasOwnProperty('empty')) this.empty = opts.empty
// state

@@ -50,6 +52,2 @@ this.body = []

this.lineNo = 0
if (this.cb) {
this.on('error', this.cb)
}
}

@@ -67,3 +65,2 @@

} catch (err) {
if (this.cb) this.cb(err)
done(err)

@@ -101,5 +98,3 @@ }

// reset state
this.field = ''
this.line = []
this.isQuoted = false
this._reset()
continue

@@ -113,5 +108,13 @@ }

CSVStream.prototype.end = function (buf) {
if (this.cb) this.cb(null, this.body)
Transform.prototype.end.call(this, buf)
CSVStream.prototype._reset = function () {
this.field = ''
this.line = []
this.isQuoted = false
}
CSVStream.prototype.end = function (buf, encoding) {
var self = this
Transform.prototype.end.call(this, buf, encoding, function () {
if (self.cb) self.cb(null, self.body)
})
}
{
"name": "csv-streamify",
"version": "0.3.1",
"version": "0.3.2",
"description": "Streaming CSV Parser. Made entirely out of streams.",

@@ -5,0 +5,0 @@ "author": "Clemens Stolle",

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