title: Retrieving GET /stats of Elastic search using NodeJS client
body: <p>I can easily get this elasticsearch command (GET /_stats) response on my local environment using kibana. I however need to run the command on node.js server.
  I have tried the following but it doesn't work, rather it throws error. Can anyone help me on this please?</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const client = new Client({
   node: process.env.ES_URL,
   auth: {
   username: process.env.ES_USER,
   password: process.env.ES_PASSWORD,
    },
  });
  const stats = await client.stats();
  ...
  //The error response is TypeError: client.stats is not a function</code></pre>
  </div>
  </div>
  </p>
  <p>PS: Using this command returns the same result on Kibana (GET _cluster/health)</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const {body} = await client.cluster.health({});</code></pre>
  </div>
  </div>
  </p>