title: Why I am getting this error : kafka.Client( ) is not a constructor?
body: <p>Hi I proceeded with kafka nodejs.I am not sure why this error is coming as I did all the necessary requirements. Can anyone help me out please and below is my code -</p>
  <pre><code>var express = require('express');
  var kafka = require('kafka-node');
  var app = express();
  
  var bodyParser = require('body-parser')
  app.use( bodyParser.json() );       // to support JSON-encoded bodies
  app.use(bodyParser.urlencoded({     // to support URL-encoded bodies
    extended: true
  })); 
  
  var Producer = kafka.Producer,
      client = new kafka.Client(),
      producer = new Producer(client);
  
      producer.on('ready', function () {
          console.log('Producer is ready');
      });
      
      producer.on('error', function (err) {
          console.log('Producer is in error state');
          console.log(err);
      })
  
      app.get('/',function(req,res){
          res.json({greeting:'Kafka Producer'})
      });
      
      app.listen(4000,function(){
          console.log('Kafka producer running at 4000')
      })
  </code></pre>
  <p>And I am getting this error -</p>
  <pre><code> client = new kafka.Client(),
           ^
  
  TypeError: kafka.Client is not a constructor
      at Object.&lt;anonymous&gt; (C:\Users\NITISH\kafka-nodejs\kafka.js:12:14)
      at Module._compile (internal/modules/cjs/loader.js:1137:30)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
      at Module.load (internal/modules/cjs/loader.js:985:32)
      at Function.Module._load (internal/modules/cjs/loader.js:878:14)
      at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
      at internal/main/run_main_module.js:17:47
  </code></pre>