Files
Node.js-14-Cookbook/Chapter09/hashing-with-bcrypt/validate-password.js
T
2020-11-13 00:27:24 +00:00

11 lines
226 B
JavaScript

const password = process.argv[2];
const hash = process.argv[3];
const bcrypt = require("bcrypt");
bcrypt
.compare(password, hash)
.then((res) => {
console.log(res);
})
.catch((err) => console.error(err.message));