sequelize.js Modify attributes in beforeCreate hook Example working with a library that doesn't use Promise

30% OFF - 9th Anniversary discount on Entity Framework Extensions until December 15 with code: ZZZANNIVERSARY9

Example

User.beforeCreate(function(user, options) {
  return hashPassword(user.password).then(function (hashedPw) {
  user.password = hashedPw;
  });
})


Got any sequelize.js Question?