You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow column titles to be specified in the keys option. (#173)
* Converts the options object to accept Objects in the keys option property and optionally accept a title property in that Object. If a title property is specified, that will be used to set the column header instead of using the key field name.
Copy file name to clipboardExpand all lines: README.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -82,10 +82,12 @@ Looking for examples? Check out the Wiki: [json-2-csv Wiki](https://github.com/m
82
82
* `false` uses the following keys:
83
83
* `['specifications']`
84
84
* Note: This may result in CSV output that does not map back exactly to the original JSON. See #102 for more information.
85
-
*`keys` - Array - Specify the keys (as strings) that should be converted.
86
-
* Default: `null`
87
-
* If you have a nested object (ie. {info : {name: 'Mike'}}), then set this to ['info.name']
88
-
* If you want all keys to be converted, then specify ```null``` or don't specify the option to utilize the default.
85
+
*`keys` - Array - Specify the keys (as strings) that should be converted.
86
+
* Default: These will be auto-detected from your data by default.
87
+
* Keys can either be specified as a String representing the key path that should be converted, or as an Object with the `key` property specifying the path. When specifying keys as an Object, you can also optionally specify a `title` which will be used for that column in the header. The list specified can contain a combination of Objects and Strings.
0 commit comments