@@ -29,7 +29,7 @@ $ npm install @mrodrig/json-2-csv-cli
2929
3030## Upgrading?
3131
32- 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 ) .
32+ Upgrading to v5 from v4 ? Check out the [ upgrade guide] ( https://github.com/mrodrig/json-2-csv/blob/master/upgrade_guides/UPGRADE_4_to_5 .md ) .
3333
3434## Usage
3535
4141``` javascript
4242import { json2csv } from ' json-2-csv' ;
4343```
44- Looking for examples? Check out the Wiki: [ json-2-csv Wiki] ( https://github.com/mrodrig/json-2-csv/wiki )
4544
4645### API
4746
48- #### ` json2csv(array, options) ` => ` Promise< string> `
47+ #### ` json2csv(array, options) ` => ` string `
4948
50- Returns a ` Promise ` that resolves with the CSV ` string ` or rejects with an ` Error ` if there was an issue.
49+ Returns the CSV ` string ` or rejects with an ` Error ` if there was an issue.
5150
5251* ` array ` - An array of JSON documents to be converted to CSV.
5352* ` options ` - (Optional) A JSON document specifying any of the following key value pairs:
@@ -165,11 +164,9 @@ Returns a `Promise` that resolves with the CSV `string` or rejects with an `Erro
165164 * Default: `false`
166165
167166
168- For examples, please refer to the [json2csv API Documentation (Link)](https://github.com/mrodrig/json-2-csv/wiki/json2csv-Documentation)
167+ #### `csv2json(csv, options)` => object[]
169168
170- #### `csv2json(csv, options)` => Promise<object[]>
171-
172- Returns a `Promise` that resolves with the JSON object array (`object[]`) or rejects with an `Error` if there was an issue.
169+ Returns the JSON object array (`object[]`) or rejects with an `Error` if there was an issue.
173170
174171* `csv` - A string of CSV
175172* `options` - (Optional) A JSON document specifying any of the following key value pairs:
@@ -197,8 +194,6 @@ Returns a `Promise` that resolves with the JSON object array (`object[]`) or rej
197194 * `trimFieldValues` - Boolean - Should the field values be trimmed?
198195 * Default: `false`
199196
200- For examples, please refer to the [csv2json API Documentation (Link)](https://github.com/mrodrig/json-2-csv/wiki/csv2json-Documentation)
201-
202197### CLI
203198Note: As of `3.5.8`, the command line interface functionality has been pulled out to a separate package. Please be sure to
204199install the `@mrodrig/json-2-csv-cli` NPM package if you wish to use the CLI functionality shown below:
@@ -258,9 +253,6 @@ To see test coverage, please run:
258253$ npm run coverage
259254```
260255
261- ## Frequently Asked Questions (FAQ)
262- Please find the updated list (relocated to the Wiki) here: [ Frequently Asked Questions (Link)] ( https://github.com/mrodrig/json-2-csv/wiki/FAQ )
263-
264256## Features
265257* Header Generation (per document keys)
266258* Allows for conversion of specific keys in both json2csv and csv2json via the options.keys parameter (as of 1.1.2)
@@ -272,11 +264,11 @@ Please find the updated list (relocated to the Wiki) here: [Frequently Asked Que
272264* Allows for custom field delimiters, end of line delimiters, etc.
273265* Wrapped value support for json2csv and csv2json (as of 1.3.0)
274266* Support for multiple different schemas (as of 1.4.0)
275- * Promisified versions of the functions are now available by default: json2csvAsync, csv2jsonAsync (as of 2.2.0)
276267* RFC 4180 Compliance (as of 3.0.0)
277268* CLI functionality (as of 3.0.0)
278269 * `csv2json test.csv -o output.json`
279270 * *and*
280271 * `json2csv test.json -o output.csv -W -k arrayOfStrings -o output.csv`
281272* Empty field value option (as of 3.1.0)
282273* TypeScript typings included (as of 3.4.0) - thanks to [ @GabrielCastro ] ( https://github.com/GabrielCastro ) !
274+ * Synchronous use case support (as of 5.0.0) - thanks to [ @Nokel81 ] ( https://github.com/Nokel81 )
0 commit comments