SQL Formatter Plus Jinja (v1.3.8) is a fork of sql-formatter-plus that adds support for Jinja SQL templating syntax. It pretty-prints SQL queries with configurable indentation, uppercase keywords, and language-specific formatting for Standard SQL, N1QL, DB2, and PL/SQL. It supports named and indexed placeholder replacement for parametrized queries. The library is distributed as an ESM module via npm and can also be used directly in the browser via a script tag (global window.sqlFormatter). Compared to the original sql-formatter, this fork integrates Jinja-specific syntax highlighting, making it suitable for projects using Jinja templated SQL.
npm install sql-formatter-plus-jinjaNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic formatting with Jinja language, custom indent, uppercase keywords, and indexed placeholder replacement.
Set language explicitly to avoid surprises, e.g., language: 'sql' for standard SQL.
Refer to the original sql-formatter-plus documentation for base API, but test thoroughly with this fork.
Use dynamic import() or ensure your project is configured for ESM (e.g., type: 'module' in package.json).
Add 'type': 'module' to your package.json, or use dynamic import() instead of static import.
Run 'npm install sql-formatter-plus-jinja' and ensure the import path is exact.
Use import sqlFormatter from 'sql-formatter-plus-jinja'; then call sqlFormatter.format().