
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
excel-as-database
Advanced tools
Excel-as-Database is a powerful Node.js package designed to leverage Microsoft Excel sheets as a lightweight and easy-to-use database solution. This package simplifies CRUD operations and enables developers to seamlessly interact with Excel files as if they were conventional databases.
Simple Integration: Easily connect your Node.js application with Excel files, treating them as databases for data storage and retrieval.
SQL-like Operations: Utilize SQL-like syntax to perform CRUD operations (SELECT, INSERT, UPDATE, DELETE) on your Excel data.
Error Handling: Comprehensive error handling ensures robust performance even in challenging scenarios.
User-Friendly API: The package provides a straightforward API for developers to interact with Excel files programmatically.
Multiple Tables: Each sheet in the Excel file is treated as an individual table, allowing you to work with multiple tables within a single Excel document.
Extensive Data Checks: The package includes extensive checks on manually entered data in the Excel sheet, ensuring data integrity and preventing common errors.
npm install excel-as-database
const excelAsDatabase = require('excel-as-database');
const localExcelDb = new excelAsDatabase(`/your/absolute/folder/path/`);
await localExcelDb.createExcel(); // this will create a new Excel file at the provided folder path
Create tables
ExcelDB.xlsx
in the specified /your/absolute/folder/path/
folder.ExcelDB.xlsx
and refer to the 1st sheet, which acts as a template for creating other tables.ExcelDB.xlsx
as a separate table.Ensure that you follow the specified folder path, use the correct Excel file (ExcelDB.xlsx
), and refer to the provided image for setting up the table schema.
const selectSql = { from: "users" }
const selectSql = { select: ["*"], from: "users"}
const selectSql = { select: ["rollNo", "name"], from: "users", offset: 10 }
const selectSql= {
select: ["rollNo", "name", "surname"],
from: "users",
where: " name != 'john' ",
orderBy: ["name desc"],
}
const selectSql = {
select: ["rollNo", "name", "surname", "SUM(marks)", "AVG(marks)", "MAX(marks)", "MIN(marks)", "COUNT(marks)"],
from: "users",
where: "isActive != false and ( rollNo < 100 or name = 'john' ) and dob = 11/11/1995 and (marks + 10 > 50 )",
groupBy: ["rollNo", "name", "surname"],
having: "SUM(marks) + 5 < 150 ",
orderBy: ["rollNo", "name desc", "surname asc"],
limit: 4,
offset: 2
}
const data = await localExcelDb.select(selectSql);
const insertSql = {
table: "users",
insert: [
{
name: "lee",
isActive: true,
surname: "Yu",
dob: "13/06/1999",
marks: 45
}, {
name: "mock",
isActive: false,
surname: "rid",
dob: "13/06/1994",
marks: 41
}
]
}
await localExcelDb.insert(insertSql);
const updateSql = {
table: "users",
set: {
isActive: false,
marks: 0
},
where: "dob = 11/07/1980 and marks <= 20"
}
await localExcelDb.update(updateSql);
const deleteSql = {
from : "users",
where : "isActive = false and marks <= 0"
}
await localExcelDb.delete(deleteSql);
Feel free to contribute by opening issues, submitting pull requests, or suggesting improvements. Your feedback is valuable! Git repository - https://github.com/svfodekar/excelAsDatabase
Saurabh Foddekar
FAQs
Use Microsoft Excel as database
The npm package excel-as-database receives a total of 4 weekly downloads. As such, excel-as-database popularity was classified as not popular.
We found that excel-as-database demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.