When using sequlize to connect to a database I create a Sequlize object like this:
sequelize = new Sequelize(settings),
I don't think that'll work (well). Instead, what you could do is move the creation of the instance to a module, and use that module whenever you need to access it:
// database.js var sequelize = require('sequelize'); var settings = ...; module.exports = new Sequelize(settings); // app.js var sequelize = require('./database'); ... // models.js var sequelize = require('./database'); ...
Because calls to
require are cached, the same object will be shared amongst your files.