const bcrypt=require('bcypt') bcrypt.genSalt(saltRounds, function(err, salt) { bcrypt.hash(password, salt, function(err, hash) { //add to database }); });