A simple SQL template engine and query runner for Node.js, version 0.2.3, low release cadence. It reads SQL files from a directory, renders them with escaped values, and executes queries using a connection pool via the mysql package. Key differentiators: simple API with forge/run, streaming results, and debug output. Alternatives like Squel or Knex are more feature-rich but heavier.
npm install node-sql-templateNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows template rendering and query execution with a callback.
Install and use mysql2 instead of mysql; API is similar but more modern.
Run 'npm install mysql' alongside node-sql-template.
Use environment variables and enforce TLS with ssl option.
Specify an existing directory with SQL files.
Install mysql: npm install mysql
Use require instead of import.
Add 'database' to options.connection, e.g., { database: 'mydb' }.