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

@mrodrig/json-2-csv-cli

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mrodrig/json-2-csv-cli - npm Package Compare versions

Comparing version 4.0.0 to 4.0.1

21

bin/csv2json.js

@@ -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

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