[go: up one dir, main page]

This package has been deprecated

Author message:

WARNING: This project has been renamed to just *excel-ent*. Install using *npm install excel-ent* instead.

@numpod/excel-ent
TypeScript icon, indicating that this package has built-in type declarations

2.0.5 • Public • Published

Excel-ent

NUMPOD

NPM npm

Description

excel-ent is a helper lib to export data in XLS and CSV.

Installation

$ yarn add @numpod/excel-ent

# or with npm

$ npm install @numpod/excel-ent --save

Using excel-ent

Two main functions exportmeExcel & exportmeToCsv

exportmeExcel

exportmeExcel(data: any[], title: string, options?: CSS.Properties)

Parameters

data Required, must be an array of Object

title Required, name of the archive generated

options Optional, receives two attributes: bodyStyle and headerStyle

  • bodyStyle and headerStyle: Both receives CSS Properties in camelCase and provide style for the header and body in the Excel File

Example

import { exportmeExcel } from "@numpod/excel-ent";

const data = [
  {
    id: 1,
    name: 'Some Name',
    age: 21,
  },
  {
    id: 2,
    name: 'Some New Name',
    age: 23,
  },
  {
    id: 3,
    name: 'Some Name Again',
    age: 22,
  },
];

exportmeExcel(data, 'test', {
  bodyStyle: { fontSize: '20px' },
  headerStyle: { fontSize: '40px' },
});

Example output

Example Output - Excel Screenshot


exportmeToCsv

exportmeToCsv(data: any[], title: string)

Parameters

data Required, must be an array of Object

title Required, name of the archive generated

Example

import { exportmeToCsv } from "@numpod/excel-ent";

const data = [
  {
    id: 1,
    name: "Some Name",
    age: 21,
  },
  {
    id: 2,
    name: "Some New Name",
    age: 23,
  },
  {
    id: 3,
    name: "Some Name Again",
    age: 22,
  },
];

exportmeToCSV(data, "MyReport");

Last fux

License

@numpod/excel-ent is MIT licensed.


Thank you and be free to contribute.

Readme

Keywords

Package Sidebar

Install

npm i @numpod/excel-ent

Weekly Downloads

3

Version

2.0.5

License

MIT

Unpacked Size

8.71 kB

Total Files

5

Last publish

Collaborators

  • leoreisdias