title: how to compare bcrypt hash password
body: <p>I am new to node js, I am trying to validate a password that is encrypted, and I have given the below code which I have tried.</p>
  <pre class="lang-js prettyprint-override"><code>async function passCheck(event) {
    // in event i am passing user entered password and email
    var EnteredPassword = bcrypt.hashSync(event.password, 10); //10 saltrounds
  
    var fromDB = await pool.query('SELECT password from User WHERE email  = ?', event.emailID);
    if (EnteredPassword == fromDB) {
      //Here i am comparing
      console.log('valid');
    } else {
      console.log('invalid');
    }
  }
  </code></pre>