sequelize-associate
v1.0.5
Published
A helper to associate all sequelize models using the "associate" function.
Downloads
8
Maintainers
Readme
sequelize-associate
sequelize-associate is a javascript library that import models from a directory and associate all together.
Getting Started
These instructions will help you to get and use sequelize-associate on your app.
Installing
npm install --save sequelize-associate
Using
You can use in a index file on your models directory for example:
import sequelizeAssociate from 'sequelize-associate';
sequelizeAssociate(__dirname);
You can also pass some options:
sequelizeAssociate(__dirname, {
pattern: /\.model\.js$/, //Match all files that ends with model.js.
recursive: true //Will search in all subdirectories.
});
Authors
- Felipe Laera - Software Engineer
See also the list of contributors who participated in this project.
License
This project is licensed under the MIT License - see the LICENSE.md file for details