{"size": 448, "ext": "js", "max_stars_repo_path": "src/ping-cli.js", "max_stars_repo_name": "alexjfno1/netlify-plugin-cypress", "max_stars_repo_stars_event_min_datetime": "2020-03-19T13:41:12.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-25T23:04:55.000Z", "max_issues_repo_path": "src/ping-cli.js", "max_issues_repo_name": "alexjfno1/netlify-plugin-cypress", "max_issues_repo_issues_event_min_datetime": "2020-03-19T14:25:05.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-30T19:31:54.000Z", "max_forks_repo_path": "src/ping-cli.js", "max_forks_repo_name": "alexjfno1/netlify-plugin-cypress", "max_forks_repo_forks_event_min_datetime": "2020-03-19T14:01:44.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-30T19:27:28.000Z"}
{"max_stars_count": 77, "max_issues_count": 179, "max_forks_count": 29, "avg_line_length": 22.4, "max_line_length": 65, "alphanum_fraction": 0.640625}
// a little CLI utility for testing pinging websites
// node ./src/ping-cli <url>

const { ping } = require('./utils')
const timeoutSeconds = 60
const url = process.argv[2]
console.log('pinging url %s for %d seconds', url, timeoutSeconds)
if (!url) {
  console.error('Missing url to ping')
  process.exit(1)
}
ping(url, timeoutSeconds * 1000).then(
  () => {
    console.log('all good')
  },
  (err) => {
    console.error('a problem', err)
  },
)
