Skip to content

Commit 2efbe29

Browse files
committed
docs: clarify return values
1 parent bcf7d8e commit 2efbe29

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ Looking for examples? Check out the Wiki: [json-2-csv Wiki](https://github.com/m
4545

4646
### API
4747

48-
#### `json2csv(array, options)`
48+
#### `json2csv(array, options)` => `Promise<string>`
49+
50+
Returns a `Promise` that resolves with the CSV `string` or rejects with an `Error` if there was an issue.
4951

5052
* `array` - An array of JSON documents to be converted to CSV.
5153
* `options` - (Optional) A JSON document specifying any of the following key value pairs:
@@ -144,7 +146,9 @@ Looking for examples? Check out the Wiki: [json-2-csv Wiki](https://github.com/m
144146

145147
For examples, please refer to the [json2csv API Documentation (Link)](https://github.com/mrodrig/json-2-csv/wiki/json2csv-Documentation)
146148

147-
#### `csv2json(csv, options)`
149+
#### `csv2json(csv, options)` => Promise<object[]>
150+
151+
Returns a `Promise` that resolves with the JSON object array (`object[]`) or rejects with an `Error` if there was an issue.
148152

149153
* `csv` - A string of CSV
150154
* `options` - (Optional) A JSON document specifying any of the following key value pairs:

0 commit comments

Comments
 (0)