Skip to content

Commit 25d29dd

Browse files
authored
fix(jsdelivr): fetch just npm hits (#375)
Thanks to @MartinKolarik in #371 This is 4.3MB vs 70MB, so will be nice for our memory usage. Speed is 200ms vs 3200ms
1 parent 3c70053 commit 25d29dd

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/__tests__/__snapshots__/config.test.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ Object {
176176
"type": "synonym",
177177
},
178178
],
179-
"jsDelivrHitsEndpoint": "https://data.jsdelivr.com/v1/stats/packages/month/all",
179+
"jsDelivrHitsEndpoint": "https://data.jsdelivr.com/v1/stats/packages/npm/month/all",
180180
"maxObjSize": 450000,
181181
"npmDownloadsEndpoint": "https://api.npmjs.org/downloads",
182182
"npmRegistryEndpoint": "https://replicate.npmjs.com/registry",

src/config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ const defaultConfig = {
66
npmRegistryEndpoint: 'https://replicate.npmjs.com/registry',
77
npmDownloadsEndpoint: 'https://api.npmjs.org/downloads',
88
npmRootEndpoint: 'https://registry.npmjs.org',
9-
jsDelivrHitsEndpoint: 'https://data.jsdelivr.com/v1/stats/packages/month/all',
9+
jsDelivrHitsEndpoint:
10+
'https://data.jsdelivr.com/v1/stats/packages/npm/month/all',
1011
unpkgRoot: 'https://unpkg.com',
1112
maxObjSize: 450000,
1213
popularDownloadsRatio: 0.005,

0 commit comments

Comments
 (0)