Skip to content

whitespaca/excel-database

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ExcelDatabase

npm npm

A lightweight library for managing Excel files as databases in Node.js, built with TypeScript.

Features

  • 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.

Installation

Install the library via npm:

npm install excel-database

Usage

Import and Initialize

import { 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');

CRUD Operations

Select

const results = db.select({ columnName: 'value' });
console.log(results);

Insert

db.insert({ columnName: 'newValue', anotherColumn: 123 });

Update

db.update({ columnName: 'value' }, { columnName: 'updatedValue' });

Delete

db.delete({ columnName: 'value' });

Get Column Value

const value = db.getColumnValue('searchColumn', 'searchValue', 'targetColumn');
console.log(value);

Example

Example code is here

Contributing

Please submit issues or pull requests via GitHub.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

Manage Excel files like a database with simple CRUD operations in Node.js. Fully typed with TypeScript support.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors