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

csv-write-stream

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

csv-write-stream - npm Package Compare versions

Comparing version 0.0.3 to 0.1.0

6

index.js

@@ -12,2 +12,6 @@ var through = require('through2')

this.newline = this.opts.newline || '\n'
this.sendHeaders = this.opts.sendHeaders
if (this.sendHeaders == null) {
this.sendHeaders = true
}
this.stream = through({objectMode: true}, this.write.bind(this))

@@ -26,3 +30,3 @@ return this.stream

}
if (!this.sentHeaders) {
if (this.sendHeaders && !this.sentHeaders) {
this.stream.push(this.serialize(this.headers))

@@ -29,0 +33,0 @@ this.sentHeaders = true

2

package.json
{
"name": "csv-write-stream",
"version": "0.0.3",
"version": "0.1.0",
"description": "A CSV encoder stream that produces properly escaped CSVs",

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

@@ -53,3 +53,3 @@ # csv-write-stream

// produces: hello,foo,baz\nworld,bar,taco\n
// produces: hello,foo\nworld,bar\n
```

@@ -56,0 +56,0 @@

@@ -100,1 +100,13 @@ var test = require('tape')

})
test('no headers displayed', function(t) {
var writer = csv({sendHeaders: false})
writer.pipe(concat(function(data) {
t.equal('world,bar,taco\n', data.toString())
t.end()
}))
writer.write({hello: "world", foo: "bar", baz: "taco"})
writer.end()
})
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