SQL Formatter is a JavaScript library for pretty-printing SQL queries, supporting Standard SQL, Couchbase N1QL, IBM DB2, and Oracle PL/SQL dialects. Current stable version is 2.3.2, with maintenance releases over years. Key differentiator: lightweight, no dependencies, supports placeholder replacement (named and indexed). Lacks TypeScript support in v2 but widely used for formatting SQL in Node.js and browser. Alternatives exist (e.g., prettier-plugin-sql) but sql-formatter is simpler and more focused.
No compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Package is ESM-only from v2? Actually CJS require works for v2. Use default import for ESM.
In v2, default export is the format function. Named export also available.
Use 'language' not 'lang'. Options are part of the main export.
Demonstrates formatting SQL with parameter substitution for named placeholders.
Breaking-change detection hasn't run for this library yet.
CVE tracking and dependency tree are planned for a later release.
No traffic data recorded yet.