A utility library (v1.6.0, stable) that exports Excel workbooks (.xlsx) directly into a PostgreSQL database with options for automatic database/table creation, table dropping, and primary key generation. It simplifies ETL workflows by handling schema inference and data insertion in one call. Unlike manual CSV imports or custom scripts, this package offers a zero-config approach with TypeScript support and minimal dependencies. Release cadence is low; updates are driven by bug fixes rather than feature additions.
npm install excel-to-postgresNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic usage: connect to PostgreSQL, create DB and tables, generate primary key, and export Excel data.
Always provide an absolute or relative path to the .xlsx file. Use path.resolve if needed.
Set createDatabase: true in options, or ensure the target database exists beforehand.
Choose only one primary key option. Do not set both to true.
Convert .xls files to .xlsx first, or use a different library.
Rename columns in Excel to use only alphanumeric characters and underscores before exporting.
Use import { excelToPostgresDb } from 'excel-to-postgres' instead of require()Ensure you pass a valid file path string (e.g., './data.xlsx') to the function.
Set createDatabase: true in options, or create the database manually before calling the function.