An open API service indexing awesome lists of open source software.

https://github.com/abmsourav/exporto

A tiny JavaScript Library. It Downloads data in your chosen file type.
https://github.com/abmsourav/exporto

javascript library

Last synced: over 1 year ago
JSON representation

A tiny JavaScript Library. It Downloads data in your chosen file type.

Awesome Lists containing this project

README

          

# Exporto
A tiny JavaScript Library. It Download data in your choosen file type.
It'll create a button, and download data in file.

### Options:
`targetNode` (required) - Dom Element. Button will be created in this dom element.

`id` (required) - unique Button ID.

`data` (required) - Data that will be downloaded.

`fileType` (optional) - Default: `text/plain`.

`fileExtension` (optional) - Default: `.txt`

`className` (optional) - Default: `''`

`buttonText` (optional) - Default: `Button`


### Example

```js
const expt = document.querySelector('.export');

const options = {
targetNode: expt,
id: 'exporto',
data: 'Apple,Orange,Pineapple',
fileType: 'text/csv',
fileExtension: '.csv',
className: 'export-btn',
buttonText: 'Export'
}
Exporto( options ).loaded();
```

![Exporto demo](https://github.com/AbmSourav/exporto/blob/dev/doc-resource/Exporto-doc.gif)