sqlizr
Automatically load Sequelize models via glob pattern.
Installation
npm i --save sqlizr
Usage
Define a model somewhere that is ready for Sequelize#import.
module { var User = sequelize User { User } return User}
var sqlizr = var sequelize = ... var db = dbUser
Associations
If you define an associate
function on your model definition, sqlizr will run that function
after all models have been loaded, passing in a hash of all loaded models for easy reference.
Setup any needed associations in the associate
function, like shown in the example above.