1.0.2 • Published 7 years ago
ember-csv v1.0.2
ember-csv
This addon provides ember CSV utilities.
Currently, it just provides a component for generating a download anchor based on CSV modeled data. So, doing this:
{{component "ember-csv@file-anchor" data=data}}// 2D array of CSV rows
this.set('data', [
['First Name', 'Last Name'],
['Foo', 'Bar']
]);...would yield something like this:
<a href="<data-uri-generated-here>">
Download CSV file
</a>...and opening the file downloaded from that anchor would yield this:
First Name,Last Name
Foo,BarInstallation
ember install csv-anchorUsage
You can override the downloaded file name by specifying the fileName argument:
{{component "ember-csv@file-anchor"
data=data
fileName="foobar"
}}...with this argument, the download will show up as foobar.csv on your computer.
You can always play with the dummy app for usage details (See contributing).
Contributing
Installation
git clone <repository-url>cd csv-anchornpm install
Linting
npm run lint:jsnpm run lint:js -- --fix
Running tests
ember test– Runs the test suite on the current Ember versionember test --server– Runs the test suite in "watch mode"npm test– Runsember try:eachto test your addon against multiple Ember versions
Running the dummy application
ember serve- Visit the dummy application at http://localhost:4200.
For more information on using ember-cli, visit https://ember-cli.com/.
License
This project is licensed under the MIT License