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.
- Host: GitHub
- URL: https://github.com/abmsourav/exporto
- Owner: AbmSourav
- License: mit
- Created: 2020-11-01T10:35:45.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-11-03T07:08:43.000Z (over 5 years ago)
- Last Synced: 2024-10-19T22:09:12.582Z (over 1 year ago)
- Topics: javascript, library
- Homepage:
- Size: 1.33 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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();
```
