diff options
| author | Dax Raad <[email protected]> | 2025-11-08 20:21:02 -0500 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2025-11-08 20:21:02 -0500 |
| commit | 4d20e1c3c6207cf6731ad8db9f92caf4ef31cb99 (patch) | |
| tree | 1c0b14810b8919e0d9dba022384da876717f8e2e /script | |
| parent | 4bb7ea91271e85621a1394c70867ddc26be45631 (diff) | |
| parent | 969af4d54122b727d7251b2977f617424d08e4cb (diff) | |
| download | opencode-4d20e1c3c6207cf6731ad8db9f92caf4ef31cb99.tar.gz opencode-4d20e1c3c6207cf6731ad8db9f92caf4ef31cb99.zip | |
Merge remote-tracking branch 'origin/dev' into dev
Diffstat (limited to 'script')
| -rwxr-xr-x | script/stats.ts | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/script/stats.ts b/script/stats.ts index 30e71ffd5..d5f6c103f 100755 --- a/script/stats.ts +++ b/script/stats.ts @@ -54,9 +54,7 @@ async function fetchNpmDownloads(packageName: string): Promise<number> { // Use a range from 2020 to current year + 5 years to ensure it works forever const currentYear = new Date().getFullYear() const endYear = currentYear + 5 - const response = await fetch( - `https://api.npmjs.org/downloads/range/2020-01-01:${endYear}-12-31/${packageName}`, - ) + const response = await fetch(`https://api.npmjs.org/downloads/range/2020-01-01:${endYear}-12-31/${packageName}`) if (!response.ok) { console.warn(`Failed to fetch npm downloads for ${packageName}: ${response.status}`) return 0 @@ -168,11 +166,7 @@ async function save(githubTotal: number, npmDownloads: number) { ? ` (${githubChange.toLocaleString()})` : " (+0)" const npmChangeStr = - npmChange > 0 - ? ` (+${npmChange.toLocaleString()})` - : npmChange < 0 - ? ` (${npmChange.toLocaleString()})` - : " (+0)" + npmChange > 0 ? ` (+${npmChange.toLocaleString()})` : npmChange < 0 ? ` (${npmChange.toLocaleString()})` : " (+0)" const totalChangeStr = totalChange > 0 ? ` (+${totalChange.toLocaleString()})` @@ -226,8 +220,6 @@ console.log(` npm: ${npmDownloads.toLocaleString()}`) console.log("=".repeat(60)) console.log("-".repeat(60)) -console.log( - `GitHub Total: ${githubTotal.toLocaleString()} downloads across ${releases.length} releases`, -) +console.log(`GitHub Total: ${githubTotal.toLocaleString()} downloads across ${releases.length} releases`) console.log(`npm Total: ${npmDownloads.toLocaleString()} downloads`) console.log(`Combined Total: ${totalDownloads.toLocaleString()} downloads`) |
