Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
customulize
Advanced tools
#customulize
Add arbitrary custom functions to sequelize models
##Installation
npm install customulize
##usage
var customulize = require('customulize');
var sequelizeCps = customulize('cps', function(model, method) {
return function() {
var newArgs = Array.prototype.slice.call(arguments),
callback = newArgs.pop();
model[method].apply(model, newArgs).complete(callback);
};
});
// 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) {
});
});
##kgo
customulize allows you to create a lazy calling pattern, eg:
var sequelazy = customulize('lazy', function(model, method) {
return function() {
var query = model[method].apply(model, arguments);
return query.complete.bind(query);
};
});
When using kgo this is especially convenient:
kgo
('account', Account.lazy.find({where: {id: 1}}))
('update', ['account'], function(account, done) {
account.name = 'John';
account.cps.save(done);
})
// etc, etc, etc
Pull requests welcome with passing tests.
FAQs
Add arbitrary custom callbacks to sequelize
The npm package customulize receives a total of 29 weekly downloads. As such, customulize popularity was classified as not popular.
We found that customulize demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.