@@ -24,17 +24,17 @@ The columns headings will be used as the JSON document keys. All lines must hav
2424$ npm install json-2-csv
2525```
2626
27+ ## Upgrading?
28+
29+ Upgrading to v3 from v2? Check out the [ upgrade guide] ( https://github.com/mrodrig/json-2-csv/blob/master/upgrade_guides/UPGRADE_2_to_3.md ) .
30+
2731## Usage
2832
2933``` javascript
3034let converter = require (' json-2-csv' );
3135```
3236Looking for examples? Check out the Wiki: [ json-2-csv Wiki] ( https://github.com/mrodrig/json-2-csv/wiki )
3337
34- ## Upgrading?
35-
36- Upgrading to v3 from v2? Check out the [ upgrade guide] ( https://github.com/mrodrig/json-2-csv/blob/master/upgrade_guides/UPGRADE_2_to_3.md ) .
37-
3838### API
3939
4040#### ` converter.json2csv(array, callback, options) `
@@ -123,6 +123,46 @@ For examples, please refer to the [csv2json API Documentation (Link)](https://gi
123123
124124Available in version ` 2.2.0 ` , this functionality makes use of promises from the ` bluebird ` module.
125125
126+ ### CLI
127+ #### json2csv
128+ ```
129+ Usage: json2csv <jsonFile> [options]
130+
131+ Options:
132+ -V, --version output the version number
133+ -o, --output [output] Path of output file. If not provided, then stdout will be used
134+ -f, --field <delimiter> Optional field delimiter
135+ -w, --wrap <delimiter> Optional wrap delimiter
136+ -e, --eol <delimiter> Optional end of line delimiter
137+ -b, --excel-bom Excel Byte Order Mark character prepended to CSV
138+ -W, --without-header Withhold the prepended header
139+ -s, --sort-header Sort the header fields
140+ -H, --trim-header Trim header fields
141+ -F, --trim-fields Trim field values
142+ -S, --check-schema Check for schema differences
143+ -E, --empty-field-value <value> Empty field value
144+ -k, --keys [keys] Keys of documents to convert to CSV
145+ -h, --help output usage information
146+ ```
147+
148+ #### csv2json
149+ ```
150+ Usage: csv2json <csvFile> [options]
151+
152+ Options:
153+ -V, --version output the version number
154+ -c, --csv <csv> Path of json file to be converted
155+ -o, --output [output] Path of output file. If not provided, then stdout will be used
156+ -f, --field <delimiter> Optional field delimiter
157+ -w, --wrap <delimiter> Optional wrap delimiter
158+ -e, --eol <delimiter> Optional end of line delimiter
159+ -b, --excel-bom Excel Byte Order Mark character prepended to CSV
160+ -H, --trim-header Trim header fields
161+ -F, --trim-fields Trim field values
162+ -k, --keys [keys] Keys of documents to convert to CSV
163+ -h, --help output usage information
164+ ```
165+
126166## Tests
127167
128168``` bash
0 commit comments