A simple web component to download an array of arrays (or array-like objects) as a CSV file. It extends the <a>
element.
Install the component using Bower:
$ bower install csv-download --save
Or download as ZIP.
-
Import Web Components' polyfill:
<script src="bower_components/webcomponentsjs/webcomponents.min.js"></script>
-
Import the csv-download element:
<link rel="import" href="bower_components/csv-download/dist/csv-download.html">
-
Start using it!
<a is="csv-download" data="{{someArray}}" download="someCsv.csv"></a>
Attribute | Options | Default | Description |
---|---|---|---|
data |
array | [] |
Array of arrays to be converted to csv. |
download |
string | data.csv |
Default filename. |
delimiter |
string | , |
Delimiter to separate the columns. |
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -m 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D