
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
escape-sql-string
Advanced tools
Simple SQL string escape.
import escapeString from 'escape-sql-string';
const sqlString = "Sup'er"
console.log(escapeString(sqlString)) // => Sup''er
npm install escape-sql-string
Original implementation from sql-escape-string with the added typescript support
Escapes the given string to protect against SQL injection attacks.
By default, it assumes that backslashes are not supported as they are not part of the standard SQL spec. Quoting from the SQLite website:
C-style escapes using the backslash character are not supported because they are not standard SQL.
This means three things:
"
are not escaped by default''
instead of \'
'backslash: \\'
.It is recommended to set the backslashSupported
option true
if your SQL
engine supports it. In that case backslash sequences are escaped and single
and double quotes are escaped via a backslash, i.e. '\''
.
Parameters
value
String the original string to be used in a SQL queryoptions
Object opts
options.backslashSupported
Boolean? if true
backslashes are supported (optional, default false
)opts
Returns String the original string escaped wrapped in single quotes, i.e. 'mystring'
MIT
FAQs
Simple SQL string escape.
The npm package escape-sql-string receives a total of 7,876 weekly downloads. As such, escape-sql-string popularity was classified as popular.
We found that escape-sql-string demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.