Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request - last update date of a package #828

Open
emish89 opened this issue Feb 20, 2021 · 5 comments
Open

Feature request - last update date of a package #828

emish89 opened this issue Feb 20, 2021 · 5 comments

Comments

@emish89
Copy link

emish89 commented Feb 20, 2021

Hi guys,
from my point of view can be very useful to see when was the last update date of a package. In this way, you can find potentially abandoned or deprecated dependencies.
The age is a data that I think can be exposed by NCU and I will be pleased to try to help to add it.
Can you give me some info on where start to check?

Thanks a lot for the help and for this fantastic package!

@raineorshine
Copy link
Owner

raineorshine commented Feb 20, 2021

Hi, thanks for the proposal. The --format option would be a great place for this feature, as it allows additional information to be added to the output.

Take a look at how the "repo" format adds information to the output table:

const repoUrl = format.includes('repo')
? getRepoUrl(dep) || ''
: ''
return [dep, from, '→', toColorized, ownerChanged, repoUrl]

Ideally you should get the time along with the upgraded version rather than making a separate request. This happens in https://github.com/raineorshine/npm-check-updates/blob/main/lib/package-managers/npm.js. Unfortunately there is not an existing mechanism to return the time along with the version; the function signature currently only returns the version number.

The other complication is that ncu currently supports five different targets. I'm guessing latest (default) is the desired target for you, and you could just implement for latest and ignore the other targets if you wanted. The possible targets are latest, newest, greatest, minor, and patch (represented by individual functions in package-managers/npm.js). Accessing the time of the upgraded version may vary slightly between the different target getters. e.g. newest already requests the time, but latest gets the version published on the latest tag directly.

@Nettsentrisk
Copy link

It would be great to be able to target versions of packages that have existed for X amount of time, or since X date. If you would like to update versions that aren't the bleeding edge but have been used for a good amount of time, then you would want some kind of option like this.

@raineorshine
Copy link
Owner

@Nettsentrisk I think that would be a useful feature. That issue is being tracked in #833.

@srmagura
Copy link
Contributor

srmagura commented Jul 4, 2022

@raineorshine Do you think this would be a useful feature? I'm not sure.

OP (@emish89) said they thought this would be useful to find abandoned packages, but only packages with updates available will appear in the npm-check-updates output. And, if a package is abandoned, there is a good chance you are already on the latest version.

Maybe there is another use case where the publish date would be useful? Or maybe we should just close this and work on #833 instead?

@raineorshine
Copy link
Owner

raineorshine commented Jul 4, 2022

They are two separate features.

This issue is for a new --format option that shows the publish date.

#833 is for filtering by publish date.

Both features are natural additions to npm-check-updates. Just need a motivated individual to make a PR. However, I agree that npm-check-updates is not the ideal tool to identify abandoned packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants