AobaJSXL is a TypeScript library designed to parse, manipulate, and generate Excel .xlsx files. It provides a robust API to transform JSON data into Excel files and vice versa, leveraging the power of JSZip for ZIP file handling and OpenXML standards for Excel file structure.
- JSON to Excel Transformation: Easily convert JSON data into
.xlsxfiles. - Excel Parsing: Extract and process data from existing
.xlsxfiles. - Sheet Management: Add, update, and retrieve data from worksheets.
- Shared Strings Support: Efficiently handle shared strings for text reuse in Excel files.
- Lightweight and Fast: Built on top of JSZip for efficient ZIP file handling.
Install AobaJSXL via npm or yarn:
npm install aobajsxlor
yarn add aobajsxlThe Excel class is the main entry point for interfacing with the library. It provides methods to parse and generate Excel files.
import { Excel } from 'aobajsxl';
import { Excel } from 'aobajsxl';
const excel = new Excel();
// Load an Excel file
await excel.read('example.xlsx');
// Access sheet data
const sheetData = excel.getData('Sheet1');
console.log(sheetData);
import { Excel } from 'aobajsxl';
const excel = new Excel();
// Add data to a sheet
excel.setData('Sheet1', [
{ Name: 'Alice', Age: 25 },
{ Name: 'Bob', Age: 30 },
]);
// Generate the Excel file
await excel.write('example.xlsx');
API Document - Excel
src/
├── base/
│ ├── excel-core.ts # Core functionality for handling Excel components
│ ├── excel-data-handler.ts # Internal class for parsing and generating Excel files
├── index.ts # Entry point exposing the Excel class
- Node.js (v14 or higher)
- npm or yarn
- Clone the repository:
git clone https://github.com/jchirayil/aobajsxl.git
cd aobajsxl- Install dependencies:
npm installTo build the library
npm run buildTo run the test suite:
npm testContributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Commit your changes and push the branch.
- Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
- JSZip for Zip file handling.
- OpenXML standards for Excel file structure.
For questions or support, please open an issue on the GitHub repository.