Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@mrodrig/json-2-csv-cli
Advanced tools
Convert JSON to CSV or CSV to JSON
This module provides the command line interface functionality for the json-2-csv package.
CLI:
$ npm install -g @mrodrig/json-2-csv-cli
Usage: json2csv <jsonFile> [options]
Arguments:
jsonFile JSON file to convert
Options:
-V, --version output the version number
-o, --output [output] Path of output file. If not provided, then stdout will be used
-a, --array-indexes-as-keys Includes array indexes in the generated keys
-S, --check-schema Check for schema differences
-f, --field <delimiter> Field delimiter
-w, --wrap <delimiter> Wrap delimiter
-e, --eol <delimiter> End of Line delimiter
-E, --empty-field-value <value> Empty field value
-n, --expand-nested-objects Expand nested objects to be deep converted to CSV
-k, --keys [keys] Keys of documents to convert to CSV
-d, --escape-header-nested-dots Escape header nested dots
-b, --excel-bom Excel Byte Order Mark character prepended to CSV
-x, --exclude-keys [keys] Comma separated list of keys to exclude
-A, --expand-array-objects Expand array objects
-W, --without-header Withhold the prepended header
-p, --prevent-csv-injection Prevent CSV Injection
-s, --sort-header Sort the header fields
-F, --trim-fields Trim field values
-H, --trim-header Trim header fields
-U, --unwind-arrays Unwind array values to their own CSV line
-I, --iso-date-format Use ISO 8601 date format
-L, --locale-format Use locale format for values
-B, --wrap-booleans Wrap booleans
-h, --help display help for command
Usage: csv2json <csvFile> [options]
Arguments:
csvFile CSV file to convert
Options:
-V, --version output the version number
-o, --output [output] Path of output file. If not provided, then stdout will be used
-f, --field <delimiter> Field delimiter
-w, --wrap <delimiter> Wrap delimiter
-e, --eol <delimiter> End of Line delimiter
-b, --excel-bom Excel Byte Order Mark character prepended to CSV
-p, --prevent-csv-injection Prevent CSV Injection
-F, --trim-fields Trim field values
-H, --trim-header Trim header fields
-h, --header-fields Specify the fields names in place a header line in the CSV itself
-k, --keys [keys] Keys of documents to convert to CSV
--help display help for command
To increase the allowed heap size, set max_old_space_size
in NODE_OPTIONS
.
Linux/macOs:
export NODE_OPTIONS=--max_old_space_size=4096
Windows:
set NODE_OPTIONS=--max_old_space_size=4096
FAQs
CLI for the json-2-csv package
We found that @mrodrig/json-2-csv-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.