Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aviskarkc10/file-exporter
A utility to export pdf and csv files from your web app.
https://github.com/aviskarkc10/file-exporter
csv-export javascript-library pdf-export
Last synced: 30 days ago
JSON representation
A utility to export pdf and csv files from your web app.
- Host: GitHub
- URL: https://github.com/aviskarkc10/file-exporter
- Owner: aviskarkc10
- License: mit
- Created: 2018-08-31T17:10:50.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-02T01:42:35.000Z (about 5 years ago)
- Last Synced: 2024-10-13T01:19:06.063Z (2 months ago)
- Topics: csv-export, javascript-library, pdf-export
- Language: JavaScript
- Size: 174 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-nepal - file-exporter
README
# File Exporter
A utility to export pdf and csv files from your web app. File Exporter allows you to download pdf and csv files from strings or base64 encodings on your client.
# Installation
## Using npm
```bash
$ npm install file-exporter --save
```## Using yarn
```bash
$ yarn add file-exporter
```# Usage
## Require
```
const fileExporter = require('file-exporter');
```## ES6 import
```
import fileExporter from 'file-exporter';
```## Named imports
```
import { downloadCSV, downloadCSVFromBase64, downloadPDFromBase64, downloadCSVFromArray } from 'file-exporter';
```# Examples
```
// Exporting CSV from string
downloadCSV(data, fileName);// Example format of data for downloadCSV function
Name,Address
John Smith,New York
John Doe,Mississippi// Exporting CSV from array of objects
downloadCSVFromArray(data, fileName);// Example format of data for downloadCSVFromArray function
[{name: 'John Smith', address: 'New York'}, {name: 'John Doe', address: 'Mississippi'}]// Exporting CSV from base64
downloadCSVFromBase64(data, fileName);// Exporting PDF from base64
downloadPDFFromBase64(data, fileName);
```# Contributing
Your inputs to the project are welcome. You can create an issue or send in a PR. Please see [here](https://github.com/aviskarkc10/file-exporter/blob/master/CONTRIBUTION.md).
# License
[MIT](https://github.com/aviskarkc10/file-exporter/blob/master/LICENSE)