Skip to content

Commit

Permalink
npm downloads: Better experience for new projects (#1892)
Browse files Browse the repository at this point in the history
When a new project is created, the download badge shows “project not found” as reported in #1882. This gives a more informative message in that case.
  • Loading branch information
paulmelnikow authored Aug 11, 2018
1 parent 39776d5 commit ed81dcb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion services/npm/npm-downloads.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function DownloadsForInterval(interval) {
let { downloads } = await this._requestJson({
schema,
url: `https://api.npmjs.org/downloads/${query}/${packageName}`,
notFoundMessage: 'project not found',
notFoundMessage: 'package not found or too new',
})
if (isRange) {
downloads = downloads
Expand Down
2 changes: 1 addition & 1 deletion services/npm/npm.tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ t.create('total downloads of unknown package')
.get('/dt/npm-api-does-not-have-this-package.json?style=_shields_test')
.expectJSON({
name: 'downloads',
value: 'project not found',
value: 'package not found or too new',
colorB: colorsB.red,
})

Expand Down

0 comments on commit ed81dcb

Please sign in to comment.