@mrodrig/json-2-csv-cli
Advanced tools
Comparing version 4.0.0 to 4.0.1
@@ -7,3 +7,3 @@ #!/usr/bin/env node | ||
utils = require('./utils/utils'), | ||
program = require('commander'); | ||
{ program } = require('commander'); | ||
@@ -13,3 +13,2 @@ program | ||
.usage('<csvFile> [options]') | ||
.option('-c, --csv <csv>', 'Path of json file to be converted', utils.readInputFile) | ||
.option('-o, --output [output]', 'Path of output file. If not provided, then stdout will be used', utils.convertToAbsolutePath) | ||
@@ -25,15 +24,17 @@ .option('-f, --field <delimiter>', 'Optional field delimiter') | ||
const options = program.opts(); | ||
Promise.resolve({ | ||
csv: utils.readInputFile(program.args && program.args.length && program.args[0]), | ||
output: program.output, | ||
output: options.output, | ||
options: { | ||
delimiter: { | ||
field: program.field, | ||
wrap: program.wrap, | ||
eol: program.eol | ||
field: options.field, | ||
wrap: options.wrap, | ||
eol: options.eol | ||
}, | ||
excelBOM: Boolean(program.excelBom), | ||
trimHeaderFields: Boolean(program.trimHeader), | ||
trimFieldValues: Boolean(program.trimFields), | ||
keys: program.keys | ||
excelBOM: Boolean(options.excelBom), | ||
trimHeaderFields: Boolean(options.trimHeader), | ||
trimFieldValues: Boolean(options.trimFields), | ||
keys: options.keys | ||
} | ||
@@ -40,0 +41,0 @@ }) |
@@ -7,3 +7,3 @@ #!/usr/bin/env node | ||
utils = require('./utils/utils'), | ||
program = require('commander'); | ||
{ program } = require('commander'); | ||
@@ -29,21 +29,23 @@ program | ||
const options = program.opts(); | ||
Promise.resolve({ | ||
json: utils.readInputFile(program.args && program.args.length && program.args[0]), | ||
output: program.output, | ||
output: options.output, | ||
options: { | ||
delimiter: { | ||
field: program.field, | ||
wrap: program.wrap, | ||
eol: program.eol | ||
field: options.field, | ||
wrap: options.wrap, | ||
eol: options.eol | ||
}, | ||
excelBOM: Boolean(program.excelBom), | ||
prependHeader: !program.withoutHeader, | ||
sortHeader: Boolean(program.sortHeader), | ||
trimHeaderFields: Boolean(program.trimHeader), | ||
trimFieldValues: Boolean(program.trimFields), | ||
checkSchemaDifferences: Boolean(program.checkSchema), | ||
expandArrayObjects: Boolean(program.expandArrayObjects), | ||
unwindArrays: Boolean(program.unwindArrays), | ||
emptyFieldValue: program.emptyFieldValue, | ||
keys: program.keys | ||
excelBOM: Boolean(options.excelBom), | ||
prependHeader: !options.withoutHeader, | ||
sortHeader: Boolean(options.sortHeader), | ||
trimHeaderFields: Boolean(options.trimHeader), | ||
trimFieldValues: Boolean(options.trimFields), | ||
checkSchemaDifferences: Boolean(options.checkSchema), | ||
expandArrayObjects: Boolean(options.expandArrayObjects), | ||
unwindArrays: Boolean(options.unwindArrays), | ||
emptyFieldValue: options.emptyFieldValue, | ||
keys: options.keys | ||
} | ||
@@ -50,0 +52,0 @@ }) |
@@ -5,3 +5,3 @@ { | ||
"description": "CLI for the json-2-csv package", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"repository": { | ||
@@ -33,4 +33,4 @@ "type": "git", | ||
"dependencies": { | ||
"commander": "8.3.0", | ||
"json-2-csv": "^3.17.0" | ||
"commander": "9.4.1", | ||
"json-2-csv": "^3.17.2" | ||
}, | ||
@@ -37,0 +37,0 @@ "engines": { |
@@ -48,3 +48,2 @@ # json-2-csv-cli | ||
-V, --version output the version number | ||
-c, --csv <csv> Path of json file to be converted | ||
-o, --output [output] Path of output file. If not provided, then stdout will be used | ||
@@ -51,0 +50,0 @@ -f, --field <delimiter> Optional field delimiter |
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
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
167
10015
71
+ Addedcommander@9.4.1(transitive)
- Removedcommander@8.3.0(transitive)
Updatedcommander@9.4.1
Updatedjson-2-csv@^3.17.2