sequelize-cps
v1.1.0
Published
Add CPS, error-first callbacks to sequelize
Downloads
2,785
Readme
#sequelize-cps
Adds CPS functionality (Error First) to sequelize via customulize for cases when promises just aren't for you.
##Installation
npm install sequelize-cps
##usage
var sequelizeCps = require('sequelize-cps'),
// define your sequelize models
var models = {
Account: require('./account')
};
// call function over them
sequelizeCps(models);
// now you can call methods via cps
models.Account.cps.find({ where: { id: 1} }, function(error, account) {
if (error) {
// error logic
}
account.name = 'John';
account.cps.save(function(error, account) {
});
});
Pull requests welcome with passing tests.