Socket
Socket
Sign inDemoInstall

csv-parser

Package Overview
Dependencies
Maintainers
2
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

csv-parser - npm Package Compare versions

Comparing version 1.6.0 to 1.7.0

25

bin.js
#!/usr/bin/env node
var minimist = require('minimist')
var ldjson = require('ldjson-stream')
var ndjson = require('ndjson')
var fs = require('fs')

@@ -32,8 +32,11 @@ var csv = require('./')

'Usage: csv-parser [filename?] [options]\n\n' +
' --headers,-h Explicitly specify csv headers as a comma separated list\n' +
' --output,-o Set output file. Defaults to stdout\n' +
' --separator,-s Set the separator character ("," by default)\n' +
' --strict Require column length match headers length\n' +
' --version,-v Print out the installed version\n' +
' --help Show this help\n'
' --headers,-h Explicitly specify csv headers as a comma separated list\n' +
' --output,-o Set output file. Defaults to stdout\n' +
' --separator,-s Set the separator character ("," by default)\n' +
' --strict Require column length match headers length\n' +
' --version,-v Print out the installed version\n' +
' --outputSeparator Put between JSON items in the output (default \\n)\n' +
' --beforeOutput Put at beginning of output (default nothing)\n' +
' --afterOutput Put at end of output (default \\n)\n' +
' --help Show this help\n'
)

@@ -55,2 +58,8 @@ process.exit(1)

var serializeOpts = {
separator: argv.outputSeparator,
before: argv.beforeOutput,
after: argv.afterOutput
}
input

@@ -62,3 +71,3 @@ .pipe(csv({

}))
.pipe(ldjson.serialize())
.pipe(ndjson.serialize(serializeOpts))
.pipe(output)
{
"name": "csv-parser",
"version": "1.6.0",
"version": "1.7.0",
"description": "Streaming CSV parser that aims for maximum speed as well as compatibility with the csv-spectrum test suite",
"repository": {
"type": "git",
"url": "https://github.com/mafintosh/csv-parser"
"url": "git+https://github.com/mafintosh/csv-parser.git"
},

@@ -13,4 +13,4 @@ "dependencies": {

"inherits": "^2.0.1",
"ldjson-stream": "^1.1.0",
"minimist": "^0.2.0"
"minimist": "^0.2.0",
"ndjson": "^1.4.0"
},

@@ -46,3 +46,3 @@ "devDependencies": {

"author": "mafintosh",
"license": "BSD"
"license": "BSD-3-Clause"
}

@@ -82,4 +82,12 @@ # csv-parser

### Options
You can specify these CLI flags to control the JSON serialization output format
- `outputSeparator` - default `\n`, what to put between JSON items in the output
- 'beforeOutput` - default empty, what to put at beginning of output
- `afterOutput` - default `\n`, what to put at end of output
## License
MIT
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