{"_id":"sql-escape-string","_rev":"4-143ea12c29ef0f73f30b5b4cec286207","name":"sql-escape-string","description":"Simple SQL string escape.","dist-tags":{"latest":"1.1.0"},"versions":{"0.1.0":{"name":"sql-escape-string","version":"0.1.0","description":"Simple SQL string escape.","main":"sql-escape-string.js","scripts":{"test":"tape test/*.js"},"repository":{"type":"git","url":"git://github.com/thlorenz/sql-escape-string.git"},"homepage":"https://github.com/thlorenz/sql-escape-string","dependencies":{},"devDependencies":{"tape":"^4.8.0"},"keywords":["sql","escape","injection","security"],"author":{"name":"Thorsten Lorenz","email":"thlorenz@gmx.de","url":"http://thlorenz.com"},"license":{"type":"MIT","url":"https://github.com/thlorenz/sql-escape-string/blob/master/LICENSE"},"engine":{"node":">=6"},"gitHead":"737324e877884804f3713e8714edbbdded68f5da","bugs":{"url":"https://github.com/thlorenz/sql-escape-string/issues"},"_id":"sql-escape-string@0.1.0","_shasum":"c48bcdf23c1a7df16ebeeed9cb27626f245ccc8f","_from":".","_npmVersion":"2.15.12","_nodeVersion":"8.9.1","_npmUser":{"name":"thlorenz","email":"thlorenz@gmx.de"},"dist":{"shasum":"c48bcdf23c1a7df16ebeeed9cb27626f245ccc8f","tarball":"https://registry.npmjs.org/sql-escape-string/-/sql-escape-string-0.1.0.tgz","integrity":"sha512-Asf5ILvv/q9BVG1tERgv5a6yI/Mpdvzu0tdYeZu8s6dvWJGfoT7ogGTyext/vwISzWbdOakbyKhc0v/WuBgpqg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBMiBEDD5YPKCkVq7NDxrxnR7UxJEAhkquM6Ae1dA7k5AiB3Tlh6wR909oM6xlydX9KWjf+oFJ1FlcT2zzOUBdOqaQ=="}]},"maintainers":[{"name":"thlorenz","email":"thlorenz@gmx.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sql-escape-string-0.1.0.tgz_1516593694616_0.3516679019667208"}},"1.0.0":{"name":"sql-escape-string","version":"1.0.0","description":"Simple SQL string escape.","main":"sql-escape-string.js","scripts":{"test":"tape test/*.js"},"files":["sql-escape-string.js"],"repository":{"type":"git","url":"git://github.com/thlorenz/sql-escape-string.git"},"homepage":"https://github.com/thlorenz/sql-escape-string","dependencies":{},"devDependencies":{"tape":"^4.8.0"},"keywords":["sql","escape","injection","security"],"author":{"name":"Thorsten Lorenz","email":"thlorenz@gmx.de","url":"http://thlorenz.com"},"license":{"type":"MIT","url":"https://github.com/thlorenz/sql-escape-string/blob/master/LICENSE"},"engine":{"node":">=6"},"gitHead":"8935a35287b479e7985a999134ff141af585e778","bugs":{"url":"https://github.com/thlorenz/sql-escape-string/issues"},"_id":"sql-escape-string@1.0.0","_shasum":"59c367c959fb3a9b04a99a46ea9b7892f1a40462","_from":".","_npmVersion":"2.15.12","_nodeVersion":"8.9.1","_npmUser":{"name":"thlorenz","email":"thlorenz@gmx.de"},"dist":{"shasum":"59c367c959fb3a9b04a99a46ea9b7892f1a40462","tarball":"https://registry.npmjs.org/sql-escape-string/-/sql-escape-string-1.0.0.tgz","integrity":"sha512-ta8n+mSLmUVzunYFi497KTrqoIYuEJGPjRnxBDXcmU7mtDANaZ9kfHZWLPxI/Kw9DE1kOO1OoBx1hwMbVTAv0g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDwC3bT56eS8eJO8RFW7pqkDQ+m4LaNUxnlygzdvvDkMgIgGCtOGXl0om5DphdwdfFW+5Ytd20mCahKA7Bj99F7+F4="}]},"maintainers":[{"name":"thlorenz","email":"thlorenz@gmx.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sql-escape-string-1.0.0.tgz_1516627497886_0.38519442779943347"}},"1.1.0":{"name":"sql-escape-string","version":"1.1.0","description":"Simple SQL string escape.","main":"sql-escape-string.js","scripts":{"test":"tape test/*.js"},"files":["sql-escape-string.js"],"repository":{"type":"git","url":"git://github.com/thlorenz/sql-escape-string.git"},"homepage":"https://github.com/thlorenz/sql-escape-string","dependencies":{},"devDependencies":{"tape":"^4.8.0"},"keywords":["sql","escape","injection","security"],"author":{"name":"Thorsten Lorenz","email":"thlorenz@gmx.de","url":"http://thlorenz.com"},"license":{"type":"MIT","url":"https://github.com/thlorenz/sql-escape-string/blob/master/LICENSE"},"engine":{"node":">=6"},"gitHead":"496768a2c9d00662e24afb8500140a70e8c31a2f","bugs":{"url":"https://github.com/thlorenz/sql-escape-string/issues"},"_id":"sql-escape-string@1.1.0","_shasum":"fe744b8514868c0eb4bfb9e4a989271d40f30eb9","_from":".","_npmVersion":"2.15.12","_nodeVersion":"8.9.1","_npmUser":{"name":"thlorenz","email":"thlorenz@gmx.de"},"dist":{"shasum":"fe744b8514868c0eb4bfb9e4a989271d40f30eb9","tarball":"https://registry.npmjs.org/sql-escape-string/-/sql-escape-string-1.1.0.tgz","integrity":"sha512-/kqO4pLZSLfV0KsBM2xkVh2S3GbjJJone37d7gYwLyP0c+REh3vnmkhQ7VwNrX76igC0OhJWpTg0ukkdef9vvA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDCdoydyMKhee78s7CHfoBY5G0sQ+uxYBSsHcHDyX+prwIhAK1tIvoHLPUnABer485iFSFQjX+hrjmBp3w6TJpWT/LL"}]},"maintainers":[{"name":"thlorenz","email":"thlorenz@gmx.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sql-escape-string-1.1.0.tgz_1516659342291_0.8090752991847694"}}},"readme":"# sql-escape-string [![build status](https://secure.travis-ci.org/thlorenz/sql-escape-string.svg?branch=master)](http://travis-ci.org/thlorenz/sql-escape-string)\n\nSimple SQL string escape.\n\n```js\nconst escapeString = require('sql-string-escape')\nconst sqlString = \"Sup'er\"\nconsole.log(escapeString(sqlString)) // => Sup''er\n```\n\n## Installation\n\n    npm install sql-escape-string\n\n## Note\n\nOriginal implementation from [sqlstring](https://github.com/mysqljs/sqlstring) with the added\noption of supporting or not supporting backslash. \n\n## [API](https://thlorenz.github.io/sql-escape-string)\n\n<!-- Generated by documentation.js. Update this documentation by updating the source code. -->\n\n### escapeString\n\nEscapes the given string to protect against SQL injection attacks.\n\nBy default it assumes that backslashes are not supported as they are not part of the standard SQL spec.\nQuoting from the [SQLlite web site](https://sqlite.org/lang_expr.html):\n\n> C-style escapes using the backslash character are not supported because they are not standard SQL.\n\nThis means three things:\n\n-   backslashes and double quotes `\"` are not escaped by default\n-   single quotes are escaped via `''` instead of `\\'`\n-   your sql engine should throw an error when encountering a backslash escape\n    as part of a string, unless it is a literal backslash, i.e. `'backslash: \\\\'`.\n\nIt is recommended to set the `backslashSupported` option `true` if your SQL\nengine supports it. In that case backslash sequences are escaped and single\nand double quotes are escaped via a backslash, i.e. `'\\''`.\n\n**Parameters**\n\n-   `val` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** the original string to be used in a SQL query\n-   `$0` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** opts\n    -   `$0.backslashSupported` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** if `true` backslashes are supported (optional, default `false`)\n-   `opts`  \n\nReturns **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** the original string escaped wrapped in single quotes, i.e. `'mystring'`\n\n## License\n\nMIT\n","maintainers":[{"name":"thlorenz","email":"thlorenz@gmx.de"}],"time":{"modified":"2022-06-26T23:13:51.854Z","created":"2018-01-22T04:01:35.498Z","0.1.0":"2018-01-22T04:01:35.498Z","1.0.0":"2018-01-22T13:24:57.965Z","1.1.0":"2018-01-22T22:15:43.233Z"},"homepage":"https://github.com/thlorenz/sql-escape-string","keywords":["sql","escape","injection","security"],"repository":{"type":"git","url":"git://github.com/thlorenz/sql-escape-string.git"},"author":{"name":"Thorsten Lorenz","email":"thlorenz@gmx.de","url":"http://thlorenz.com"},"bugs":{"url":"https://github.com/thlorenz/sql-escape-string/issues"},"license":{"type":"MIT","url":"https://github.com/thlorenz/sql-escape-string/blob/master/LICENSE"},"readmeFilename":"README.md"}