Badgen.net: Fallback to the original npm registry (or jsdelivr) when unpkg fail

Created on 27 Jun 2019  路  3Comments  路  Source: badgen/badgen.net

For couple of hours I got error 500. First noticed that a ton of badges are just broken on ton of repos. So then I tried to create new project (for which I use mine charlike scaffolder which is again using the unpkg registry too) it turns out that unpkg returns 500 for non-cached packages (which is still strange cuz it should have mine pacakges already cached, but probably some cache invalidation happen in recent months).

So, we need to handle this case and fallback to some more reliable source of truth. I bet on jsdelivr, cuz as we know the npm registry sucks a bit.

Most helpful comment

Just found this https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md#abbreviated-metadata-format

Let's fix npm version badge once and for all!

All 3 comments

It turns out that it's even more freaking, because all of my fully automated publishing and releasing is based on the unpkg.com, by the @tunnckcore/package-json package. The irony is that I cannot even update it, because the publish/release tool uses it too. So, the only way is to manually publish a patch. Or, to patch the charlike locally on my machine.

Switched to jsdelivr now, let's see if it's more stable.

Just found this https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md#abbreviated-metadata-format

Let's fix npm version badge once and for all!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bjankord picture bjankord  路  3Comments

szmarczak picture szmarczak  路  5Comments

papb picture papb  路  3Comments

tunnckoCore picture tunnckoCore  路  4Comments

GMartigny picture GMartigny  路  6Comments