()
| 8 | const startYear = 2019 |
| 9 | |
| 10 | async function readExistingStats() { |
| 11 | try { |
| 12 | return JSON.parse(await readFile(outputPath, 'utf-8')) |
| 13 | } |
| 14 | catch { |
| 15 | return { |
| 16 | repository, |
| 17 | stars: 0, |
| 18 | releaseDownloads: 0, |
| 19 | activeDevelopmentStartYear: startYear, |
| 20 | activeDevelopmentYears: new Date().getUTCFullYear() - startYear, |
| 21 | updatedAt: null, |
| 22 | } |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | function createHeaders() { |
| 27 | const headers = { |