@cd2/es-qu-el
TypeScript icon, indicating that this package has built-in type declarations

0.14.0 • Public • Published

CircleCI

ES-QU-EL

yarn add @cd2/es-qu-el

Sanitizing using the SQL function

The SQL function will automatically escape any interpolated into the string.

import { SQL } from "@cd2/es-qu-el"

const userInput = `dangerous user input ' OR true; `

const sql = SQL`SELECT * FROM table WHERE thing=${userInput}`

A function can be interpolated which will get access to an object with many sanitizers:

const table = `my_table`

const sql = SQL`SELECT * FROM ${as => as.name(table)}`

Readme

Keywords

none

Package Sidebar

Install

npm i @cd2/es-qu-el

Weekly Downloads

20

Version

0.14.0

License

MIT

Unpacked Size

164 kB

Total Files

45

Last publish

Collaborators

  • smosix
  • hexmodr
  • cd2developers