1.2.3 • Published 5 years ago

file-exporter v1.2.3

Weekly downloads
6
License
MIT
Repository
github
Last release
5 years ago

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

$ npm install file-exporter --save

Using yarn

$ 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.

License

MIT

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago