devkits-sql-formatter
v1.0.7
Published
SQL formatter and minifier — beautify or compress SQL queries. Zero dependencies.
Downloads
193
Maintainers
Readme
devkits-sql-formatter
SQL formatter and minifier — beautify or compress SQL queries instantly.
💰 Support DevKits
Love these tools? Support development via Open Collective
- $5/mo - Supporter (priority support)
- $9/mo - Pro (early access to new tools)
- $29 - Lifetime (all current + future Pro features)
Install
npm install -g devkits-sql-formatterUsage
CLI
# Format SQL
sql-formatter --format "SELECT * FROM users WHERE id = 1"
# Minify SQL
sql-formatter --minify "SELECT * FROM users"
# Short aliases
sqlformat "SELECT * FROM users"
sqlmin "SELECT * FROM users"API
const { format, minify } = require('devkits-sql-formatter');
// Format SQL
const formatted = format('SELECT * FROM users WHERE id = 1', {
indent: ' ',
uppercase: true
});
// Minify SQL
const minified = minify('SELECT * FROM users');Features
- SQL beautification
- SQL minification
- Configurable indentation
- Uppercase keyword option
- Zero dependencies
Links
License
MIT
