xlsx-finder
v1.0.0
Published
Tiny utility to search Excel files by column or value
Maintainers
Readme
xlsx-finder
Tiny utility to search Excel files (.xlsx) by column or value. Works across multiple sheets and files, with case-insensitive matching.
Install
npm install xlsx-finderUsage
const {
readExcelFiles,
searchByColumn,
searchByValue,
writeResultsToExcel,
} = require('xlsx-finder');
// Read Excel files
const data = readExcelFiles(['./files/file1.xlsx', './files/file2.xlsx']);
// Search by column
const columnResults = searchByColumn(data, 'COLUMN_NAME', 'VALUE');
// Search by any value
const valueResults = searchByValue(data, 'ABC1234');
// Optionally write results to Excel
writeResultsToExcel(valueResults, './result/search_results.xlsx');API
readExcelFiles(filePaths)
Reads Excel files from given paths and returns an array of rows with _sourceFile metadata.
filePaths: string[] – Array of Excel file paths.
returns: Array – Combined rows from all sheets and files.
searchByColumn(data, column, value)
Searches rows where a specific column matches the given value (case-insensitive).
data: Array – Rows from Excel files.
column: string – Column name to search.
value: string|number – Value to match.
returns: Array – Filtered rows.
searchByValue(data, value)
Searches rows where any column matches the given value (case-insensitive).
data: Array – Rows from Excel files.
value: string|number – Value to match.
returns: Array – Filtered rows.
writeResultsToExcel(data, outputPath)
Writes an array of rows to a new Excel file.
data: Array – Rows to write.
outputPath: string – File path to save Excel.
License
MIT
