title: Imported async data from another module in Node does not resolve, how can I fix this?
body: <p>This is the module that collections and exports async data: scraper.js</p>
  
  <pre><code>const express = require('express')
  const cheerio = require('cheerio')
  const request = require("tinyreq")
  const fs = require('fs')
  const _ = require('lodash')
  const uuid = require('uuid/v4')
  const async = require('async')
  
  
  const mental_models = {
      url: 'https://www.farnamstreetblog.com/mental-models/',
      data: {}
  }
  const decision_making = {
      url: 'https://www.farnamstreetblog.com/smart-decisions/',
      data: {}
  }
  const cognitive_bias = {
      url: 'https://betterhumans.coach.me/cognitive-bias-cheat-sheet-55a472476b18',
      data: {}
  }
  const DATA_URLS = [mental_models, decision_making, cognitive_bias]
  
  const filterScrape = async (source, params) =&gt; {
  
      let filtered_data = {
          topics: [],
          content: [],
          additional_content: []
      }
  
      let response = await scrape(source)
  
      try {
          let $ = cheerio.load(response)
  
          params.forEach((elem) =&gt; {
              let headers = ['h1', 'h2', 'h3']
              if ($(elem) &amp;&amp; headers.includes(elem)) {
  
                  let topic = {}
                  let content = {}
                  let id = uuid()
                  topic.id = id
                  topic.text = $(elem).text()
  
                  if ($(elem).closest('p')) {
                      content.text = $(elem).closest('p').text()
                      content.id = id
                  }
                  filtered_data.topics.push(topic)
                  filtered_data.content.push(content)
              } else if ($(elem) &amp;&amp; !headers.includes(elem)) {
  
                  let content = {}
                  let id = uuid()
                  content.text = $(elem).text()
                  content.id = id
                  filtered_data.additional_content.push(content)
  
              } else {
  
              }
          })
  
      }
      catch (err) {
          console.log(err)
      }
  
      return filtered_data
  
  }
  
  const scrape = (source) =&gt; {
      return new Promise((resolve, reject) =&gt; {
          request(source.url, function (err, body) {
              if (err) {
                  reject(err)
                  return
              }
              resolve(body)
          })
      })
  }
  
  const DATA = _.map(DATA_URLS, async (source) =&gt; {
  
      let params = ['h1', 'h2', 'h3', 'p']
      let new_data = await filterScrape(source, params)
  
      try {
          source.data = new_data
       }
       catch (err) {
           console.log(err)
       }
  
  })
  module.exports = DATA
  </code></pre>
  
  <p>This is the module that imports the data: neural.js</p>
  
  <pre><code>const brain = require('brain')
  const neural_net = new brain.NeuralNetwork()
  const DATA = require('./scraper')
  
  console.log(DATA)
  </code></pre>
  
  <p>Obviously not much going on, I've removed the code since the variable doesn't resolve. When logged it logs a promise but the promise does not resolve. However in the imported module, the promise is logged and then resolves. What gives? Should I import a function that resolves the data?</p>