1.0.6 • Published 3 years ago

exceljs-export v1.0.6

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Exceljs-export

Exceljs-export is a library to export data to an automatically generated excel with only sending 3 parameters

Installation

To install, you can use npm

$ npm install exceljs-export

Usage

//sent data from local
import SaveExcel from 'exceljs-export'
const titlesProps =['n1', 'n2', 'n3'];
const dataProps =[[1,2,3],[4,5,6]];
SaveExcel({ data: dataProps, documentName: 'exportacionExcel', titles:titlesProps });

//sent data from endpoint
import SaveExcel from 'exceljs-export'
import axios from 'axios'

const exportUsers = () => {
    const users = async () => {
      const res = await axios.get('https://jsonplaceholder.typicode.com/todos?_limit=10') 
      return res.data.map(item => Object.values(item))
    }
    users().then(res=>SaveExcel({ data: res, documentName: 'prueba', titles: ['User ID', 'ID', 'Title','Completado'] }))
}

exportUsers();

Examples

Data exported from endpoint

sent data from endpoint

Data exported from local

sent data from local

Props

Properties required by the library, data type, definition and examples.

NameTypeDescriptionExamples
titlesArray of number or stringTitle of the columns to show in the excel document'User ID', 'ID', 'Title','Completado'
dataArray of Arrays of number or stringData to export to excel document[1,2,3,4,5,6]
documentNameStringThis is the name of the document'testDocument'

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Created by Rafael Martinez

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago