A lightweight npm package for minifying SQL statements by removing unnecessary whitespace and comments. Version 1.0.0, released recently, with no known release cadence. Handles single-line and multi-line comments, optionally preserves comments in condensed form, and detects unclosed strings/comments throwing errors. Performs minification in a single pass for efficiency. Minimal API surface with one main function.
npm install sql-minifierNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Installs sql-minifier, minifies a SQL string with and without preserving comments, showing both outputs.
Use `const { minifySQL } = require('sql-minifier')` or configure your project to use CommonJS.Always pass options as an object: `minifySQL(sql, { includeComments: true })`.Ensure your SQL does not depend on whitespace for parsing; write standard SQL that is whitespace-agnostic.
Ensure string literals are properly escaped; avoid containing comment tokens inside strings that could confuse the minifier.
Use destructuring: `const { minifySQL } = require('sql-minifier')`.Use require or rename file to .mjs and ensure package.json has type:module.
Use `const { minifySQL } = require('sql-minifier')`.No dependency data recorded yet.