{"size": 355, "ext": "js", "max_stars_repo_path": "bot/src/commands/stats.js", "max_stars_repo_name": "joemccann/the-cvd-bot", "max_stars_repo_stars_event_min_datetime": "2020-03-09T16:38:31.000Z", "max_stars_repo_stars_event_max_datetime": "2021-02-13T17:15:09.000Z", "max_issues_repo_path": "bot/src/commands/stats.js", "max_issues_repo_name": "joemccann/the-cvd-bot", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "bot/src/commands/stats.js", "max_forks_repo_name": "joemccann/the-cvd-bot", "max_forks_repo_forks_event_min_datetime": "2020-03-20T18:48:12.000Z", "max_forks_repo_forks_event_max_datetime": "2020-03-20T18:48:12.000Z"}
{"max_stars_count": 4, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 22.1875, "max_line_length": 68, "alphanum_fraction": 0.6253521127}
const fetch = require('node-fetch')

module.exports = async (URL) => {
  const STATS_URL = URL || 'https://corona.lmao.ninja/all'
  try {
    const response = await fetch(STATS_URL)

    if (!response.ok) return { err: new Error(response.statusText) }

    const data = await response.json()
    return { data }
  } catch (err) {
    return { err }
  }
}
