title: How do I use async functions in dialogflow?
body: <p>I'm getting the error as <strong>"async functions' is only available in es8 (use 'esversion 8')"</strong>
  I tried putting <strong>"esversion:8"</strong> in inline code, package.json but its not working out and function is not getting deployed.</p>
  
  <p>Code: 
  <strong><em>index.js</em></strong></p>
  
  <pre><code>'use strict';
  'use esversion: 8'; //not working
  
  async function getWeather() {
        const city = 'Mumbai';
        const OPENWEATHER_API_KEY = '&lt;API KEY&gt;';
  
  
        const response = await fetch(`http://api.openweathermap.org/data/2.5/weather?q=${city}&amp;appid=${OPENWEATHER_API_KEY}`);
        const data = await response.json();
        console.log(data);
  
        const { main } = data;
        const { temp } = main;
        const kelvin = temp;
        const celsius = Math.round(kelvin - 273.15);
  
        console.log(celsius);
     }
  
  </code></pre>
  
  <p>Code <strong><em>package.json</em></strong></p>
  
  <pre><code>{
    "name": "dialogflowFirebaseFulfillment",
    "description": "This is the default fulfillment for a Dialogflow agents using Cloud Functions for Firebase",
    "version": "0.0.1",
    "private": true,
    "license": "Apache Version 2.0",
    "author": "Google Inc.",
    "engines": {
      "node": "8"
    },
    "scripts": {
      "start": "firebase serve --only functions:dialogflowFirebaseFulfillment",
      "deploy": "firebase deploy --only functions:dialogflowFirebaseFulfillment"
    },
    "dependencies": {
      "actions-on-google": "^2.2.0",
      "firebase-admin": "^5.13.1",
      "firebase-functions": "^2.0.2",
      "dialogflow": "^0.6.0",
      "dialogflow-fulfillment": "^0.5.0",
      "esversion":"8"  //not working
    }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/VAW45.png" rel="nofollow noreferrer">Error Screenshot</a></p>
  
  <p>Is there any solution to this or any other way?</p>