# where-parser

> A utility for parsing SQL where clauses

Latest version **1.0.0** (published 2023-08-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install where-parser
pnpm add where-parser
yarn add where-parser
bun add where-parser
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2023-08-27 |
| First published | 2012-12-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | * |
| Dependencies | 2 |
| Unpacked size | 31 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Abbey Hawk Sparrow |
| Maintainers | khrome |
| Keywords | SQL, parser, permissions |

## Links

- npm: https://www.npmjs.com/package/where-parser
- Homepage: https://github.com/khrome/where-parser
- Issues: https://github.com/khrome/where-parser/issues
- npm.io page: https://npm.io/package/where-parser

## Dependencies (2)

- [browser-or-node](https://npm.io/package/browser-or-node.md) ^2.1.1
- [@open-automaton/moka](https://npm.io/package/@open-automaton/moka.md) ^0.0.4

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2023-08-27
- 0.1.1 — 2016-10-02
- 0.1.0 — 2016-09-28
- 0.0.2-alpha — 2013-02-05
- 0.0.1-alpha — 2012-12-18

## README

where-parser.js
==============
An NPM for parsing SQL where clauses

Usage
-----
First include the module:

    var WhereParser = require('./where-parser');

then, instantiate the object:

    var parser = new WhereParser();
    
now you can issue queries:

    parse.parse(myWhereClause)

and you'll get back a tree of objects where each node is one of:

    {
        type: 'expression',
        key: '<key>',
        operator: <operator>,
        value: <value>
    }    


    {
        type: 'conjunction',
        value: <value>
    }    

    []
    

Testing
-------

Run the tests at the project root with:

    mocha

Enjoy,

-Abbey Hawk Sparrow

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