title: How to connect Redshift database using Node JS
body: <p>I am not able to connect to the redshift database using Node. I am using Node JS version <code>14.15.1</code>.
  Is there any issue related to this version?</p>
  <p>The following code, I have tried in my local machine,
  <code>redshift.js</code> file</p>
  <pre><code>var Redshift = require('node-redshift');
   
  var client = {
      user: 'user',
      database: 'db',
      password: 'password',
      port: port,
      host: 'hostname',
  };
  
  var redshiftClient = new Redshift(client, {rawConnection:true});
   
  module.exports = redshiftClient;
  </code></pre>
  <p>The following is the code to get the values from database,
  <code>index.js</code> file</p>
  <pre><code>var redshiftClient = require('./redshift.js');
  
  console.log('Before Connection');
  redshiftClient.connect(function(err){
  console.log('After Connection');
      if(err) throw err;
      else{
        redshiftClient.query('SELECT * FROM &quot;customer&quot;', {raw: true}, function(err, data){
          if(err) throw err;
          else{
            console.log(data);
            redshiftClient.close();
          }
        });
      }
    });
  </code></pre>
  <p>If I run this code not getting the error and even this line is also not executed <code>console.log('After Connection');</code></p>