# json2sequelize-clause

> this module function is to generate sequelize where cluase from json format

Latest version **1.0.3** (published 2022-01-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install json2sequelize-clause
pnpm add json2sequelize-clause
yarn add json2sequelize-clause
bun add json2sequelize-clause
```

## 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.3 |
| Published | 2022-01-04 |
| First published | 2021-06-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 23.7 KB |
| Known vulnerabilities | 0 (+7 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | wisnuds |
| Maintainers | wisnuds |
| Keywords | sequelize, json, converter |

## Links

- npm: https://www.npmjs.com/package/json2sequelize-clause
- Repository: https://github.com/WisnuDS/json2sequelize-clause
- Homepage: https://github.com/WisnuDS/json2sequelize-clause#readme
- Issues: https://github.com/WisnuDS/json2sequelize-clause/issues
- npm.io page: https://npm.io/package/json2sequelize-clause

## Dependencies (4)

- [moment](https://npm.io/package/moment.md) ^2.29.1
- [mysql2](https://npm.io/package/mysql2.md) ^2.2.5
- [sqlite3](https://npm.io/package/sqlite3.md) ^5.0.2
- [sequelize](https://npm.io/package/sequelize.md) ^6.6.2

## 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.3 (latest) — 2022-01-04
- 1.0.2 — 2021-12-26
- 1.0.1 — 2021-12-26
- 1.0.0 — 2021-06-23

## README

# json2sequelize-clause


## Description

This module or package is used to convert json format into a clause where sequelize. This makes it easier for you to create dynamic filter formats

## Getting Started

### Installing

```
npm i json2sequelize-clause
```

### Executing program

You can import library and use it for convert json to sequelize where clause
```
const User = require('./config')
const convert = require('json2sequelize-clause')

const clause = [
  {
      "column": "name",
      "function_name": "contains",
      "value": "Farcha",
      "operator": "where"
  },
  {
      "column": "age",
      "function_name": ">",
      "value": 21,
      "operator": "or"
  }
]

User.findAll({
    where: convert(clauses.does_not_contains)
}).then(results => {
    console.log(results)
})
```

For more example clause you can access [here](https://github.com/WisnuDS/json2sequelize-clause/blob/master/test/clauses.json) 

## Authors

* [WisnuDS](https://www.instagram.com/wisnuds__/)

## Version History
* 1.0.3
  * Update structure and recursive strategy
* 1.0.2
    * Update documentation in README.md
* 1.0.1
    * Update some attributes
    * Create some test cases
    * See [commit change](https://github.com/WisnuDS/json2sequelize-clause/commit/d81055e82d583d49047695c9d49b25e588563d8d)
* 1.0.0
    * Initial Release

## License

This project is licensed under the ISC License

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