badges / shields

Concise, consistent, and legible badges in SVG and raster format
https://shields.io
Creative Commons Zero v1.0 Universal
22.99k stars 5.47k forks source link

npm latest package update time #10023

Open nicfv opened 3 months ago

nicfv commented 3 months ago

📋 Description

It would be great to show the latest updated date for an npm package, sort of like the static relative date badge:

Relative date

image

A required badge query parameter would be the package name. Possibly an optional query parameter could be the package version, but should default to the latest version.

🔗 Data

npm v {package} time.modified

E.g.:

$ npm v smath time.modified
2024-03-10T22:40:54.837Z

🎤 Motivation

It would be great to show how recently my package has been updated, to show that it is still being maintained.

chris48s commented 3 months ago

This does appear to be exposed via the NPM API If we call something like https://registry.npmjs.org/express/ there is a key called time which is a map of version number to timestamp. We could look up the latest version in that.

nicfv commented 3 months ago

If we call something like https://registry.npmjs.org/express/ there is a key called time which is a map of version number to timestamp.

I didn't know about this api! Thanks for sharing. Looking forward to (hopefully) a new badge soon!

saloni0419 commented 2 months ago

Can you please assign this issue to me

nicfv commented 2 months ago

@saloni0419 It doesn't look like I have permission to assign issues, but go for it, if you're interested working on it! Looks like PR #10083 hasn't been touched in over 3 weeks, so not sure if anything will happen there.