# sequelize-where

> Pure JS implementation of the sequelize query language (where)

Latest version **1.0.1** (published 2021-03-04) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2021-03-04 |
| First published | 2018-08-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 8.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Contra |
| Maintainers | contra |
| Keywords | sequelize, where, query, json, object, mock |

## Links

- npm: https://www.npmjs.com/package/sequelize-where
- Repository: https://github.com/contra/sequelize-where
- Homepage: https://github.com/contra/sequelize-where#readme
- Issues: https://github.com/contra/sequelize-where/issues
- npm.io page: https://npm.io/package/sequelize-where

## Dependencies (5)

- [dot-prop](https://npm.io/package/dot-prop.md) ^6.0.0
- [regexp-like](https://npm.io/package/regexp-like.md) ^1.1.1
- [is-plain-obj](https://npm.io/package/is-plain-obj.md) ^3.0.0
- [lodash.isequal](https://npm.io/package/lodash.isequal.md) ^4.5.0
- [lodash.intersection](https://npm.io/package/lodash.intersection.md) ^4.4.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.1 (latest) — 2021-03-04
- 1.0.0 — 2019-09-12
- 0.1.2 — 2018-08-13
- 0.1.1 — 2018-08-07
- 0.1.0 — 2018-08-07

## README

# sequelize-where [![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url]

Simple query language for filtering objects. Pure JS implementation of the `where` part of queries from Sequelize.

## Install

```
npm install sequelize-where --save
```

## Usage

```js
import filter from 'sequelize-where'

// filter takes a query object and returns a function
// the filter function returned takes one object argument - the input data
const fn = filter({
  $or: [
    { a: 'c' },
    { a: 'd' },
    { b: { $in: [ 'd', 'e', 'f' ] } }
  ]
})

console.log(fn({ a: 'c' })) // true
console.log(fn({ a: 'd' })) // true
console.log(fn({ a: 'f' })) // false
console.log(fn({ a: 'f', b: 'e' })) // true
```

[downloads-image]: http://img.shields.io/npm/dm/sequelize-where.svg
[npm-url]: https://npmjs.org/package/sequelize-where
[npm-image]: http://img.shields.io/npm/v/sequelize-where.svg

[travis-url]: https://travis-ci.org/contra/sequelize-where
[travis-image]: https://travis-ci.org/contra/sequelize-where.png?branch=master

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