Skip to content

zorro-del-caribe/ship-hold-model-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ship-hold-model-loader

CircleCI load ship-hold models based on convention

install

npm install ship-hold-model-loader

usage

assuming you have

.
|
|---models
|     |----Users.js
|     |----Products.js

Users.js and Products.js following the regular ship-hold model definition pattern

module.exports = function (h){
 return {
   table:'users',
   columns:{},
   relations:{}
 };
};

then use ship-hold-model-loader

const sh = require('ship-hold')(/* options */)
const models = require('ship-hold-model-loader')(sh) // can pass options here

models.Products === sh.model('Products'); // true

options to path the factory

  • folder: the folder to read through to find the model files (default './models')
  • exclude: an array of file to exclude (default empty array)

About

load ship-hold models based on convention

Resources

License

Stars

Watchers

Forks

Packages

No packages published