Gathering detailed insights and metrics for sql-formatter-plus
Gathering detailed insights and metrics for sql-formatter-plus
Gathering detailed insights and metrics for sql-formatter-plus
Gathering detailed insights and metrics for sql-formatter-plus
A whitespace formatter for different query languages
npm install sql-formatter-plus
Typescript
Module System
Node Version
NPM Version
94
Supply Chain
98.4
Quality
75.1
Maintenance
100
Vulnerability
99.6
License
JavaScript (95.41%)
HTML (4.59%)
Total Downloads
1,699,118
Last Day
8,099
Last Week
40,985
Last Month
169,967
Last Year
770,505
MIT License
91 Stars
339 Commits
37 Forks
2 Watchers
6 Branches
1 Contributors
Updated on Mar 24, 2025
Minified
Minified + Gzipped
Latest Version
1.3.6
Package Id
sql-formatter-plus@1.3.6
Unpacked Size
298.24 kB
Size
61.61 kB
File Count
27
NPM Version
6.12.1
Node Version
12.10.0
Cumulative downloads
Total Downloads
Last Day
39.1%
8,099
Compared to previous day
Last Week
35.8%
40,985
Compared to previous week
Last Month
22.7%
169,967
Compared to previous month
Last Year
67.4%
770,505
Compared to previous year
A fork of SQL Formatter with some extra bug fixes and features.
Fixes:
New Features:
uppercase
config optionlinesBetweenQueries
config optionSQL Formatter is a JavaScript library for pretty-printing SQL queries. It started as a port of a PHP Library, but has since considerably diverged. It supports Standard SQL, Couchbase N1QL, IBM DB2 and Oracle PL/SQL dialects.
Get the latest version from NPM:
1npm install sql-formatter
1import sqlFormatter from 'sql-formatter-plus'; 2 3console.log(sqlFormatter.format('SELECT * FROM table1'));
This will output:
1SELECT
2 *
3FROM
4 table1
You can also pass in configuration options:
1sqlFormatter.format('SELECT *', { 2 language: 'n1ql', // Defaults to "sql" 3 indent: ' ', // Defaults to two spaces, 4 uppercase: true, // Defaults to false 5 linesBetweenQueries: 2 // Defaults to 1 6});
Currently just four SQL dialects are supported:
1// Named placeholders 2sqlFormatter.format("SELECT * FROM tbl WHERE foo = @foo", { 3 params: {foo: "'bar'"} 4})); 5 6// Indexed placeholders 7sqlFormatter.format("SELECT * FROM tbl WHERE foo = ?", { 8 params: ["'bar'"] 9}));
Both result in:
1SELECT
2 *
3FROM
4 tbl
5WHERE
6 foo = 'bar'
If you don't use a module bundler, clone the repository, run npm install
and grab a file from /dist
directory to use inside a <script>
tag.
This makes SQL Formatter available as a global variable window.sqlFormatter
.
1# run linter and tests 2npm run check
...and you're ready to poke us with a pull request.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
no SAST tool detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
63 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-05-05
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More