# json-schema2sequelize

> json-schema2sequelize =====================

Latest version **0.0.2** (published 2022-03-26) · 0 weekly downloads

## Install

```sh
npm install json-schema2sequelize
pnpm add json-schema2sequelize
yarn add json-schema2sequelize
bun add json-schema2sequelize
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2022-03-26 |
| First published | 2022-03-16 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 8.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | khrome |

## Links

- npm: https://www.npmjs.com/package/json-schema2sequelize
- npm.io page: https://npm.io/package/json-schema2sequelize

## Dependencies (1)

- [object-hash](https://npm.io/package/object-hash.md) ^3.0.0

## Recent versions

- 0.0.2 (latest) — 2022-03-26
- 0.0.1 — 2022-03-16

## README

json-schema2sequelize
=====================

Just a simple JSON to Sequelize code generator, because I needed it. Not many syntax options, but I expect that to change over time.

Usage
-----

```javascript
const converter = require('json-schema2sequelize');
converter.toSequelize('tableName', jsonSchema, {});
//returns an array of create statements
converter.toSequelizeUpdates('tableName', newJSONSchema, oldJSONSchema, {});
//returns two arrays of SQL statements in an object as `ups` and `downs
converter.toSequelizeInsert('tableName', jsonObject, {});
//returns a single insert statement from the object(s) provided
```

Testing

```bash
mocha
```

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