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