Skip to content

Commit

Permalink
fix(jsdelivr): fetch just npm hits (#375)
Browse files Browse the repository at this point in the history
Thanks to @MartinKolarik in #371

This is 4.3MB vs 70MB, so will be nice for our memory usage. Speed is 200ms vs 3200ms
  • Loading branch information
Haroenv authored Aug 5, 2019
1 parent 3c70053 commit 25d29dd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/__tests__/__snapshots__/config.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ Object {
"type": "synonym",
},
],
"jsDelivrHitsEndpoint": "https://data.jsdelivr.com/v1/stats/packages/month/all",
"jsDelivrHitsEndpoint": "https://data.jsdelivr.com/v1/stats/packages/npm/month/all",
"maxObjSize": 450000,
"npmDownloadsEndpoint": "https://api.npmjs.org/downloads",
"npmRegistryEndpoint": "https://replicate.npmjs.com/registry",
Expand Down
3 changes: 2 additions & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ const defaultConfig = {
npmRegistryEndpoint: 'https://replicate.npmjs.com/registry',
npmDownloadsEndpoint: 'https://api.npmjs.org/downloads',
npmRootEndpoint: 'https://registry.npmjs.org',
jsDelivrHitsEndpoint: 'https://data.jsdelivr.com/v1/stats/packages/month/all',
jsDelivrHitsEndpoint:
'https://data.jsdelivr.com/v1/stats/packages/npm/month/all',
unpkgRoot: 'https://unpkg.com',
maxObjSize: 450000,
popularDownloadsRatio: 0.005,
Expand Down

0 comments on commit 25d29dd

Please sign in to comment.