Classes
Exporter
Kind: global class
new Exporter()
Exporter class
Exporter.module.exports
Kind: static class of Exporter
new module.exports(data, filename, extension, mimeType)
Creates an instance of Exporter.
Param | Type | Description |
---|---|---|
data | any |
Data to convert |
filename | string |
Filename for the resulting file |
extension | string |
Extension to use for the file. Use the EXTENSIONS enum as helper |
mimeType | string |
MIME expresssion. Use the MIMES enum as helper |
string
Exporter.convertJSONToCsv(json) ⇒ Converts JSON to CSV
Kind: static method of Exporter
Returns: string
- String representation of a CSV
Param | Type | Description |
---|---|---|
json | object | Array.<object> |
JSON to convert to CSV |
string
Exporter.stringifyJSON(json, [pretty]) ⇒ Stringifies JSON
Kind: static method of Exporter
Returns: string
- Stringified JSON
Param | Type | Default | Description |
---|---|---|---|
json | object | Array.<object> |
JSON to stringify | |
[pretty] | boolean |
false |
Whether to use nice spacing |
Exporter.save()
Triggers file download
Kind: static method of Exporter
Exporter.saveJSON()
Shortcut to save as JSON Processes JSON directly
Kind: static method of Exporter
Exporter.saveCSV()
Shortcut to save as CSV Processes JSON as CSV
Kind: static method of Exporter
MIMES
EXTENSIONS
Kind: global enum