const bcrypt = require('bcrypt');
// To hash user password (Sync)
let salt = bcrypt.genSaltSync(10)
hashPassword = bcrypt.hashSync(data.password, salt)
// To compare password with hashed password
// Load hash from your password DB.
bcrypt.compareSync(myPlaintextPassword, hash); // true