title: Node.js Sqlite3 if row exists
body: <p>Is there any way to check if a row exists using node.js and the sqlite module. This function is the best i have now, but it always returns false between the module is asynchronous </p>
  
  <pre><code>function auth(uname, pwd) {
      var userExists = false;
      authDB.serialize(function() {
          authDB.each("SELECT * FROM Users WHERE username = '" + uname + "' AND password = '" + pwd + "' LIMIT 1)", function(err, row) {
              userExists = true;
              console.log(userExists)
          });
      });
      return userExists;
  }
  </code></pre>
  
  <p>Is there any way to do this?</p>
  
  <p>Thanks</p>