2.1.0 • Published 4 years ago

data-exporter v2.1.0

Weekly downloads
50
License
MIT
Repository
github
Last release
4 years ago

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.

ParamTypeDescription
dataanyData to convert
filenamestringFilename for the resulting file
extensionstringExtension to use for the file. Use the EXTENSIONS enum as helper
mimeTypestringMIME expresssion. Use the MIMES enum as helper

Exporter.convertJSONToCsv(json) ⇒ string

Converts JSON to CSV

Kind: static method of Exporter
Returns: string - String representation of a CSV

ParamTypeDescription
jsonobject | Array.<object>JSON to convert to CSV

Exporter.stringifyJSON(json, pretty) ⇒ string

Stringifies JSON

Kind: static method of Exporter
Returns: string - Stringified JSON

ParamTypeDefaultDescription
jsonobject | Array.<object>JSON to stringify
prettybooleanfalseWhether 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

Kind: global enum

EXTENSIONS

Kind: global enum

2.1.0

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.0

4 years ago

0.0.4

4 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago