A pure JavaScript library, transpiled from the C# Poor Man's T-SQL Formatter library, for formatting T-SQL (Transact-SQL) code. Version 1.6.10 is the latest stable release. It provides SQL formatting, minimization, and obfuscation via a single function with options. Key differentiators: it's JavaScript-native (works in browser and Node.js), has a simple API with multiple output formats (plain text, HTML, token list, parse tree), but is approximately 8x slower than the original C# library, making it unsuitable for large batch processing. The command-line interface is distributed as a separate package.
npm install poor-mans-t-sql-formatterNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic formatting of a simple SQL query with indentation and line width options.
Use the original C# library or command-line tool for large-scale formatting tasks.
Install both: npm install poor-mans-t-sql-formatter poor-mans-t-sql-formatter-cli
Parse the result.text and look for '--WARNING' or '--ERROR' comments.
Update import from const fmt = require('poor-mans-t-sql-formatter'); fmt(...) to const { formatSql } = require('poor-mans-t-sql-formatter'); formatSql(...)Use named import: import { formatSql } from 'poor-mans-t-sql-formatter'Run: npm install poor-mans-t-sql-formatter
Ensure includeText: true (default) in options, or check for result.text existence.
No dependency data recorded yet.