# sequelize-constants

> Constants plugin for Sequelize

Latest version **1.0.0** (published 2016-10-01) · MIT license · 0 weekly downloads

## Install

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

## 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.0 |
| Published | 2016-10-01 |
| First published | 2016-10-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Brice Dauzats |
| Maintainers | qwantix |
| Keywords | sequelize, plugin |

## Links

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

## Recent versions

- 1.0.0 (latest) — 2016-10-01

## README

Sequelize constants plugin
========================

Plugin allow to define constants in sequelize model

## Usage
```javascript

const sequelize = new Sequelize( credentials, options );

// Use plugin
require('sequelize-constants')( sequelize );

const MyModel = sequelize.define('MyModel', {
    /// Here cols defs
}, {
    constant: [
        STATUS_PENDING: 'pending',
        STATUS_RUNNING: 'running',
        STATUS_COMPLETE: 'complete',
        STATUS_ERROR: 'error',
        STATUS_ABORT: 'abort'
    ]
});

/// NOW access by

console.log( MyModel.STATUS_PENDING );

MyModel.STATUS_PENDING = 'foo'; // throw an error, readonly property!

```

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