This package extends Node.js require() to support .sql files, returning the file contents as a plain string. Version 1.0.0 is the only release with no active development or updates. It is a simple convenience tool that avoids JavaScript multiline string syntax, but has no notable differentiators other than its minimal API. It essentially registers an extension handler for .sql files via require.extensions.
npm install require-sqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates how to enable .sql file loading via require() and use the resulting string.
Ensure the side-effect require is executed at the start of your application entry point.
Use ESM or dynamic imports if you need to load SQL files in ESM context; consider using fs.readFileSync instead.
Create a declaration file (e.g., declare module '*.sql' { const content: string; export default content; }) or use raw fs.readFile.Run npm install require-sql --save
require('require-sql') returns an empty object; do not assign it to a variable expecting a function.No dependency data recorded yet.