object_array_to_xlsx
v1.0.0
Published
Convert an array of object data to Excel (XLSX) files easily.
Maintainers
Readme
object_array_to_xlsx
A simple and efficient Node.js package to export data to Excel (XLSX) files.
Installation
npm install object_array_to_xlsxFeatures
- Export JSON data to XLSX files
- Customizable sheet names
- TypeScript support
- Simple and lightweight
Usage
import { exportToXlsx } from "object_array_to_xlsx";
// Your data as an array of objects
const data = [
{ name: "John", age: 30 },
{ name: "Jane", age: 25 },
];
// Export to XLSX file
exportToXlsx(data, "output.xlsx", "Users");TypeScript Usage
import { exportToXlsx } from "object_array_to_xlsx";
interface User {
name: string;
age: number;
}
const data: User[] = [
{ name: "John", age: 30 },
{ name: "Jane", age: 25 },
];
exportToXlsx(data, "output.xlsx", "Users");API Reference
exportToXlsx(data, outputPath, sheetName?)
Exports data to an Excel file.
Parameters
data(Array<Record<string, string | number | boolean>>): Array of objects to exportoutputPath(string): Path where the Excel file will be savedsheetName(string, optional): Name of the worksheet (default: "Sheet1")
Requirements
- Node.js >= 12.0.0
License
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Support
If you encounter any issues or have questions, please file an issue on the GitHub repository.
