Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ghost-sequelize

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ghost-sequelize

Ghost Creative sequelize model db service wrapper

  • 1.1.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

Ghost Sequelize

Installation

npm install ghost-sequelize --save

Overview

Config (default listed below)

{
  "database": {
    "username": "root",
    "password": "password",
    "database": "ghost_sequelize_test",
    "options": {
      "host": "localhost",
      "dialect": "mysql",
      "logging": false,
      "sync": {
        "force": false
      }
    },
    "models": {
      "dirPath": "models" // relative to the root of your project
    }
  }
}

Models

The module will attempt to load all sequelize model files from the directory provided in the config object. All models will be available via the getDb() method. See examples below.

Follow the steps below to get the module up and running.

1. Require

const GhostSequelize = require('ghost-sequelize');

2. Instantiate

const DbService = new GhostSequelize(config)
// See config above

3. Access Db (model layer)

const Db = DbService.getDb();
Db.myModel.findById('someId')
.then(result => { ... })
.catch(err => { ... });

FAQs

Package last updated on 28 Jan 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc