https://github.com/zorro-del-caribe/ship-hold-model-loader
load ship-hold models based on convention
https://github.com/zorro-del-caribe/ship-hold-model-loader
Last synced: 1 day ago
JSON representation
load ship-hold models based on convention
- Host: GitHub
- URL: https://github.com/zorro-del-caribe/ship-hold-model-loader
- Owner: zorro-del-caribe
- License: mit
- Created: 2016-07-22T14:20:21.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-07-22T15:28:10.000Z (about 9 years ago)
- Last Synced: 2025-08-05T06:49:04.949Z (2 months ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ship-hold-model-loader
[](https://circleci.com/gh/zorro-del-caribe/ship-hold-model-loader)
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](https://github.com/zorro-del-caribe/ship-hold#models)
```javascript
module.exports = function (h){
return {
table:'users',
columns:{},
relations:{}
};
};
```then use **ship-hold-model-loader**
```javascript
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)