title: Lambda function returns null with google-distance-matrix (NodeJS)
body: <p>I need to calculate the distance using the <a href="https://www.npmjs.com/package/google-distance-matrix" rel="nofollow noreferrer">google-distance-matrix</a> API in a NodeJS Lambda function but It just returns null when I run the function.</p>
  
  <pre><code>var distance = require('google-distance-matrix');
  distance.key('xxxxxxxx');
  
  var origins = ['San Francisco CA'];
  var destinations = ['New York NY', '41.8337329,-87.7321554'];
  
  var dist = function() {
      distance.matrix(origins, destinations, function (err, distances) {
          if (!err) {
              return {
                  statusCode: 200,
                  body: distances
              }
          }
      });
  }
  
  exports.handler = async (event) =&gt; {
      return dist()
  };
  </code></pre>