A TypeScript library that minifies valid Postgres SQL by tokenizing the statement and reconstructing it with standardized case and spacing. Version 1.0.7 is the current stable release, updated as needed. Key differentiator: provides a lexer, configurable keyword sets, and comment handling, making it suitable for postgres-specific SQL formatting without full parsing.
npm install pgsql-minifyNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates minifying a multi-line SQL string with mixed case and tabs into a single-line, lowercase, minimal-spacing format.
Ensure SQL is valid before minifying.
Pass { includeComments: true } to minify or lex options.Override keywords via PgSqlMinifyOptions.keywords if using non-standard SQL.
Use import { minify } from 'pgsql-minify'Use import { lex } from 'pgsql-minify'Use 'import type { TokenType } from 'pgsql-minify' or use it only as a type in TypeScript.No dependency data recorded yet.