SQL file loader for Node.js that loads .sql files from a directory into a JavaScript object. Version 1.0.3 is the current stable release. It supports relative and absolute paths, and recursively loads files from subdirectories to create nested objects. Simple alternative to other SQL loaders, no external dependencies, works with both CommonJS and ESM.
npm install sql-loaderNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Loads SQL files from directory and accesses them as object properties.
Use path.join(__dirname, './sql') to avoid ambiguity.
Use only alphanumeric and underscore in file names for predictable keys.
Use CommonJS require or transpile with bundler that handles CJS.
Run 'npm install sql-loader' and ensure your import/require is correct.
Use 'import sqlLoader from 'sql-loader'' or 'const sqlLoader = require('sql-loader')'.Ensure the path points to a directory containing .sql files.
No dependency data recorded yet.