Skip to content

AbmSourav/exporto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Contributors