csv-parser
Advanced tools
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 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Misc. License Issues
License(Experimental) A package's licensing information has fine-grained problems.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found.
Found 1 instance in 1 package
19725
0
481
93
+ Addedndjson@^1.4.0
+ Addedisarray@1.0.0(transitive)
+ Addedjson-stringify-safe@5.0.1(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedndjson@1.5.0(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedsplit2@2.2.0(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedthrough2@2.0.5(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
- Removedldjson-stream@^1.1.0
- Removedisarray@0.0.1(transitive)
- Removedldjson-stream@1.2.1(transitive)
- Removedreadable-stream@1.0.34(transitive)
- Removedsplit2@0.2.1(transitive)
- Removedstring_decoder@0.10.31(transitive)
- Removedthrough2@0.6.5(transitive)