Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const main = async () => {
const sites = await Site.list()
const to = new Date()
const from = new Date()
from.setDate(to.getDate() - 7)
console.log(`=== ${sites.length} sites`)
const metrics = await Promise.all(
sites.map(({ slug }) => {
return TimeSeries.list({
site: slug,
from: from.toUTCString(),
to: to.toUTCString(),
measurements: ['consistently-interactive']
})