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

0.17.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)}`

Dependencies (0)

    Dev Dependencies (10)

    Package Sidebar

    Install

    npm i @cd2/es-qu-el

    Weekly Downloads

    16

    Version

    0.17.0

    License

    MIT

    Unpacked Size

    106 kB

    Total Files

    45

    Last publish

    Collaborators

    • smosix
    • hexmodr
    • cd2developers