aoo_to_xlsx
TypeScript icon, indicating that this package has built-in type declarations

2.0.4 • Public • Published

aoo_to_xlsx

Convert an array of object to xlsx file.

Installing

npm i aoo_to_xlsx

Usage

convertToSheet

Convert array to single sheet excel file

Prototype

convertToSheet($data: Record<string, DefaultDataType>[], options?: ConvertOptions): Promise<void | import("exceljs").Buffer>
import { convertToSheet } from 'aoo_to_xlsx'

convertToSheet([
  { name: "John DOE", age: 45, enabled: true },
  { name: "Jane XIE", age: 45, enabled: false },
], {
  filename: "non_empty_arr",
});

Interfaces

DefaultDataType

type DefaultDataType = string | number | boolean;

ConvertOptions

interface ConvertOptions {
  headers?: Record<string, string>;

  // If it's defined, the function will genera
  filename?: string;
  path?: string;
}

Package Sidebar

Install

npm i aoo_to_xlsx

Weekly Downloads

54

Version

2.0.4

License

MIT

Unpacked Size

5.06 kB

Total Files

7

Last publish

Collaborators

  • asaje379