A PostgreSQL SQL syntax beautifier that is a thin Node.js wrapper around the Perl-based pgFormatter (https://github.com/darold/pgFormatter). Version 2.0.8 is current stable; released via npm, maintained by Gajus Kuizinas. Requires Perl on the host system. Ships TypeScript type definitions. Supports customizable formatting options like keyword/function case, indentation spaces/tabs, comma breaking, anonymization, placeholder regex, and comment stripping. Provides both programmatic API and CLI tool. Key differentiators: leverages the mature pgFormatter Perl engine, supports all PostgreSQL-specific syntax, configurable via options map matching pgFormatter flags.
npm install pg-formatterNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage of format() with options for keyword case and indentation.
Install Perl (e.g., via apt-get install perl or brew install perl).
Use import { format } from 'pg-formatter' instead of require().Use camelCase for programmatic API, kebab-case for CLI flags.
Set either spaces or tabs, not both.
Use noRcFile: true instead of no-rcfile.
Run npm install pg-formatter and verify the import: import { format } from 'pg-formatter';Install Perl (sudo apt-get install perl on Ubuntu, brew install perl on macOS).
Use import { format } from 'pg-formatter' and call format(sql).Add "type": "module" to package.json or use .mjs extension.
No dependency data recorded yet.