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


Example

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