Gathering detailed insights and metrics for @nuage/sql-fmt
Gathering detailed insights and metrics for @nuage/sql-fmt
Gathering detailed insights and metrics for @nuage/sql-fmt
Gathering detailed insights and metrics for @nuage/sql-fmt
Simple SQL escape and format for MySQL \ Postgres and easy create Ojbect to SQL
npm install @nuage/sql-fmt
Typescript
Module System
Node Version
NPM Version
JavaScript (53.17%)
TypeScript (46.83%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
1 Stars
22 Commits
1 Watchers
2 Branches
1 Contributors
Updated on Feb 19, 2021
Latest Version
1.0.4
Package Id
@nuage/sql-fmt@1.0.4
Unpacked Size
13.08 kB
Size
4.38 kB
File Count
17
NPM Version
6.14.8
Node Version
15.3.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
4
Simple SQL escape and format for MySQL \ Postgres and easy create Ojbect to SQL, support typescript.
sqlstring
escape SQL string{ key : value }
to SQL (key1, key2) VALUES (value1, value2)
{ key : value }
to SQL (key1='value1' AND key2='value2')
{ key : value }
to SQL key1='value1', key2='value2'
1$ npm install sql-fmt
In javascript use MySQL
1const sql = require("sql-fmt"); // MySQL
or use Postgres
1const sql = require("sql-fmt/pg"); // Postgres
1console.log(`SELECT * FROM users WHERE name=${sql.escape("hello")};`); 2//out: SELECT * FROM users WHERE name='hello'; 3 4console.log(`SELECT * FROM users WHERE name=${sql.escape("'hello' OR 1=1")}`); 5//out: SELECT * FROM users WHERE name='\'hello\' OR 1=1';
1console.log(`INSERT INTO users ${sql.values({ dog: "ff", age: 20 })};`);
2//out: INSERT INTO users (dog,age) VALUES ('ff',20);
3
4console.log(
5 `INSERT INTO users ${sql.values([
6 { dog: "aa", age: 10 },
7 { dog: "bb", age: 20 },
8 ])};`
9);
10//out: INSERT INTO users (dog,age) VALUES ('aa',10),('bb',20);
1console.log(`SELECT * FROM users WHERE ${sql.where({ dog: "ff", age: 20 })};`); 2//out: SELECT * FROM users WHERE (dog='ff' AND age=20); 3 4console.log( 5 `SELECT * FROM users WHERE ${sql.where({ dog: ["aa", "bb"], age: 20 })};` 6); 7//out: SELECT * FROM users WHERE ((dog='aa' OR dog='bb') AND age=20);
1console.log( 2 `UPDATE users SET ${sql.set({ dog: "ff", age: 20 })} where ${sql.where({ 3 name: "apple", 4 })};` 5); 6//out: UPDATE users SET dog='ff',age=20 where (name='apple');
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/22 approved changesets -- 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
34 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
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