PostgreSQL SQL syntax beautifier wrapping the Perl-based pgFormatter. v1.33.0 (released 2023-01-15) provides a CLI and JavaScript API for formatting SQL files, with options for indentation, keyword casing, comma placement, and comment removal. Key differentiators: specifically targets PostgreSQL dialect, supports extensive formatting rules (keywordCase, functionCase, typeCase), and offers both library and CLI usage. Requires Perl runtime. Actively maintained with monthly releases.
No compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Package ships ES module by default (since v1.0.0). CJS require() will work if using bundler that handles ESM, but direct require may fail.
Named export for formatting a single SQL string. Only available in ESM environment.
Reads a file and formats its SQL content. Returns a Promise<string>.
Demonstrates formatting a SQL string with custom options (2 spaces, lowercase keywords) using the ESM module.
Breaking-change detection hasn't run for this library yet.
CVE tracking and dependency tree are planned for a later release.