Registry / database / sqlformatter

sqlformatter

JSON →
library0.1.0jsnpmunverified

A lightweight JavaScript library for formatting basic SQL statements (DML + queries). Version 0.1.0 is a direct conversion of Hibernate's BasicFormatterImpl Java code. No updates since initial release. Simple API with a single `format()` function. Limited to basic formatting—no support for advanced SQL features or database-specific syntax. Not actively maintained.

database
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

The library does not support ESM imports; use CommonJS require.

const sqlformatter = require('sqlformatter'); sqlformatter.format(sql);

No default export; the require returns an object with a format method.

const sqlformatter = require('sqlformatter');

Shows basic usage of sqlformatter.format to format a simple SQL query.

const sqlformatter = require('sqlformatter'); const sql = 'select * from dual'; const formatted = sqlformatter.format(sql); console.log(formatted); // Output: // select // * // from // dual
Debug
Known footguns
gotchaLibrary only handles basic SQL formatting; complex queries may not be formatted correctly.
deprecatedThe library has not been updated since initial release; may not be actively maintained.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
7 hits · last 30 days
gptbot
3
ahrefsbot
1
Resources