# named-placeholders

> sql named placeholders to unnamed compiler

Latest version **1.1.6** (published 2025-12-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install named-placeholders
pnpm add named-placeholders
yarn add named-placeholders
bun add named-placeholders
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: no vulnerabilities; has provenance; high maintenance score.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 1.1.6 |
| Published | 2025-12-15 |
| First published | 2014-08-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.0.0 |
| Dependencies | 1 |
| Unpacked size | 7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 25 |
| Author | Andrey Sidorov |
| Maintainers | sidorares |
| Keywords | sql, pdo, named, placeholders, mysql, postgres |

## Links

- npm: https://www.npmjs.com/package/named-placeholders
- Repository: https://github.com/mysqljs/named-placeholders
- Homepage: https://github.com/mysqljs/named-placeholders#readme
- Issues: https://github.com/mysqljs/named-placeholders/issues
- npm.io page: https://npm.io/package/named-placeholders

## Dependencies (1)

- [lru.min](https://npm.io/package/lru.min.md) ^1.1.0

## Recent versions

- 1.1.6 (latest) — 2025-12-15
- 1.1.4 — 2025-12-08
- 1.1.3 — 2023-01-12
- 1.1.2 — 2018-11-07
- 1.1.1 — 2015-11-25
- 1.1.0 — 2015-09-21
- 1.0.0 — 2015-09-14
- 0.1.3 — 2015-01-09
- 0.1.2 — 2015-01-09
- 0.1.1 — 2014-08-30
- 0.1.0 — 2014-08-30

## README

[![NPM](https://nodei.co/npm/named-placeholders.png?downloads=true&stars=true)](https://nodei.co/npm/named-placeholders/)

[![CI](https://github.com/mysqljs/named-placeholders/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/mysqljs/named-placeholders/actions/workflows/ci.yml)

# named-placeholders

compiles "select foo where foo.id = :bar and foo.baz < :baz" into "select foo where foo.id = ? and foo.baz < ?" + ["bar", "baz"]

## usage

```sh
npm install named-placeholders
```

see [this mysql2 discussion](https://github.com/sidorares/node-mysql2/issues/117)

```js
var mysql = require('mysql');
var toUnnamed = require('named-placeholders')();

var q = toUnnamed('select 1+:test', { test: 123 });
mysql.createConnection().query(q[0], q[1]);
```

## credits

parser is based on @mscdex code of his excellent [node-mariasql](https://github.com/mscdex/node-mariasql) library

---
_Source: https://npm.io/package/named-placeholders · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
