jesseduffield/lazynpm

Updates available

Opened this issue · 2 comments

Love the idea here, just installed it and already see how this could make things much simpler. One thing that I would love, however, is some help around updates to packages.

Is your feature request related to a problem? Please describe.
I cannot find the link right now, but I recently read an article that shows some crazy high percent of dependencies are not updated after being installed. Partially this could be due to lack of visibility, partially could be due to things breaking when updating, but I think both of these problems can be helped if not solved with this terminal.

Describe the solution you'd like
I currently use an extension for VSCode named Version Lens. This works but can be very slow. I would imagine something similar, which would maybe be a third column in the dependency list that shows latest version if one exists. Additionally, a keypress on the dependency may show the change notes, or diff or something.

Maybe something like this:

express  1.0.0  1.0.0 1.1.6
lodash    5.6.3 5.6.3 -

Describe alternatives you've considered
As far as I know, from the docs and using it for about half a day, package updates are not something that is available.

Additional context
Basically, some more visibility/workflow around package updates to help ease the update process and make devs more likely to update their packages. For me, this would be very helpful as someone who tries to actively keep up to date with things. The audit data could also be useful here, to help show updates that are low priority (no audit findings), medium priority (low risk audit findings) or high priority (high risk audit findings).

I am happy to help contribute to this, however I do not currently have the bandwidth to fully take this on at the moment. I would be happy to assist, if this was deemed a worthwhile enhancement.

Regardless, thank you so much for this and I will be using it in my day-to-day!

Glad you like the project! I think this feature makes sense. I wonder if npm has an api we could use to obtain the latest versions of each project, or failing that, if github has an api for getting the latest tag (given that most npm repos are hosted on github and the package.json typically contains a link to the repo. If we can get that, it should be easy to fetch the data and render it

Well, npm CLI has the outdated command, which is sorta where I borrowed my UI idea from. Running it looks like this:

Package                            Current    Wanted    Latest  Location
@types/aws-lambda                  8.10.46   8.10.46   8.10.51  stream-api
@types/eslint                        6.1.8     6.1.8     6.8.0  stream-api
@types/express                      4.17.3    4.17.3    4.17.6  stream-api
@types/jest                         25.1.4    25.1.4    25.2.1  stream-api

Outside of this, I linked the one VS Code plugin that does this inline in package.json, and there is also an npm package I have used before that also provides a CLI way of seeing updates available: https://www.npmjs.com/package/npm-check-updates

So, the data is definitely out there, but unsure where they all load them from.