A lightweight library for managing Excel files as databases in Node.js, built with TypeScript.
- CRUD Operations: Perform create, read, update, and delete operations on Excel files.
- Column Lookup: Search rows by column values and fetch specific column values.
- TypeScript Support: Fully typed for better development experience.
Install the library via npm:
npm install excel-databaseimport { ExcelDatabase } from 'excel-database';
const db = new ExcelDatabase('path/to/your/file.xlsx');
// Default sheet name is 'Sheet1'. You can specify a custom sheet name:
const dbWithCustomSheet = new ExcelDatabase('path/to/your/file.xlsx', 'CustomSheetName');const results = db.select({ columnName: 'value' });
console.log(results);db.insert({ columnName: 'newValue', anotherColumn: 123 });db.update({ columnName: 'value' }, { columnName: 'updatedValue' });db.delete({ columnName: 'value' });const value = db.getColumnValue('searchColumn', 'searchValue', 'targetColumn');
console.log(value);Example code is here
Please submit issues or pull requests via GitHub.
This project is licensed under the MIT License. See the LICENSE file for details.