Helpful functions for common interactions.
Assign a text value to the system clipboard. Note: Due to browser security restrictions, the copy will only succeed if this method is invoked as a result of a user action (eg. user button click).
HTML:
Typescript:
Conversion function that takes a CSV representation of objects and converts them to JSON. The first row in the input must be the object keys. Custom key separator and line separator can be specified. Space indentation size for output JSON can be specified.
Conversion function that takes an array of objects and converts them to CSV format. Custom key and line separators can be specified.
HTML:
Typescript:
Download CSV content to the specified file with .csv extension appended to the provided base file name.
Download JSON content to the specified file with .json extension appended to the provided base file name.
Convert objects to CSV format and download to file with .csv extension appended to the provided base file name. Custom key separator and line separator can be specified.
Convert objects to JSON format and download to file with .json extension appended to the provided base file name.
Download string content to the specified file with desired mime type.
HTML:
Typescript:
Read file as UTF-8 text. Return string contents on read completion.
HTML
Typescript