@@ -30,12 +30,13 @@ $ npm install @mrodrig/json-2-csv-cli
3030
3131## Upgrading?
3232
33- 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 ) .
33+ Upgrading to v4 from v3 ? Check out the [ upgrade guide] ( https://github.com/mrodrig/json-2-csv/blob/master/upgrade_guides/UPGRADE_3_to_4 .md ) .
3434
3535## Usage
3636
3737``` javascript
3838let converter = require (' json-2-csv' );
39+ const csv = await converter .json2csv (data, options);
3940```
4041or
4142``` javascript
@@ -45,11 +46,9 @@ Looking for examples? Check out the Wiki: [json-2-csv Wiki](https://github.com/m
4546
4647### API
4748
48- #### ` converter. json2csv(array, callback , options)`
49+ #### ` json2csv(array, options) `
4950
5051* ` array ` - An array of JSON documents to be converted to CSV.
51- * ` callback ` - A function of the form ` function (err, csv) ` ;
52- * This function will receive any errors and/or the string of CSV generated.
5352* ` options ` - (Optional) A JSON document specifying any of the following key value pairs:
5453 * ` checkSchemaDifferences ` - Boolean - Should all documents have the same schema?
5554 * Default: ` false `
@@ -146,14 +145,9 @@ Looking for examples? Check out the Wiki: [json-2-csv Wiki](https://github.com/m
146145
147146For examples, please refer to the [json2csv API Documentation (Link)](https://github.com/mrodrig/json-2-csv/wiki/json2csv-Documentation)
148147
149- #### Promisified Version: `converter.json2csvAsync(array, options)`
150-
151- Available in version `2.2.0`, this functionality makes use of promises from the `bluebird` module.
152-
153- #### `converter.csv2json(csv, callback, options)`
148+ #### `csv2json(csv, options)`
154149
155150* `csv` - A string of CSV
156- * `callback` - A function of the form `function (err, array)`; This function will receive any errors and/or the array of JSON documents generated.
157151* `options` - (Optional) A JSON document specifying any of the following key value pairs:
158152 * `delimiter` - Document - Specifies the different types of delimiters
159153 * `field` - String - Field Delimiter.
@@ -181,10 +175,6 @@ Available in version `2.2.0`, this functionality makes use of promises from the
181175
182176For examples, please refer to the [csv2json API Documentation (Link)](https://github.com/mrodrig/json-2-csv/wiki/csv2json-Documentation)
183177
184- #### Promisified Version: `csv2jsonAsync(csv, options)`
185-
186- Available in version `2.2.0`, this functionality makes use of promises from the `bluebird` module.
187-
188178### CLI
189179Note: As of `3.5.8`, the command line interface functionality has been pulled out to a separate package. Please be sure to
190180install the `@mrodrig/json-2-csv-cli` NPM package if you wish to use the CLI functionality shown below:
@@ -244,14 +234,6 @@ To see test coverage, please run:
244234$ npm run coverage
245235```
246236
247- Current Coverage is:
248- ```
249- Statements : 100% ( 286/286 )
250- Branches : 100% ( 166/166 )
251- Functions : 100% ( 73/73 )
252- Lines : 100% ( 280/280 )
253- ```
254-
255237## Frequently Asked Questions (FAQ)
256238Please find the updated list (relocated to the Wiki) here: [ Frequently Asked Questions (Link)] ( https://github.com/mrodrig/json-2-csv/wiki/FAQ )
257239
0 commit comments