var bcrypt = require('bcryptjs'); var hash = bcrypt.hashSync('robert', 10); console.log(hash); bcrypt.compare('robert2', hash, function (fail, ok) { console.log(fail); console.log(ok); });