nvm icon indicating copy to clipboard operation
nvm copied to clipboard

Why does 'ls-remote' start from the bottom of versions and not the top?

Open raphaellueckl opened this issue 1 year ago • 8 comments

[Sorry for removing the issue template, but none of the points made sense for this ticket.]

I always wonder why 'ls-remote' doesn't start from the newest version, which mostly would allow for almost instant CTRL+C without waiting half a minute for the complete list. Is there any particular reason for this? Usually I am always too little bothered to mention it somewhere but today I thought that this has been the case for several years now and it finally should be discussed. :)

Seriously, who wants to install the node versions below 1? Below 10? Below 15?.... That ordering should be descending in my humble opinion.

Thanks for this awesome product! 🚀

raphaellueckl avatar Oct 06 '23 05:10 raphaellueckl

Because that’s how they’re listed on the remote server, so it would be a lot slower to reverse the entire download - you’d end up waiting more time.

ljharb avatar Oct 06 '23 08:10 ljharb

i mean you can just list the latest major, or --lts, etc, so usually that’s what i do when I’m not trying to see everything.

ljharb avatar Oct 09 '23 04:10 ljharb

what's a "negative LTS"? --lts says, only show me LTS versions.

ljharb avatar Oct 09 '23 05:10 ljharb

@ljharb Thx for responding. If it's the remote that delivers the list in a badly sorted way, can we somehow raise a ticket there? Wherever that is.

raphaellueckl avatar Nov 22 '23 16:11 raphaellueckl

You certainly could file an issue on nodejs/release requesting the order be inverted - although that would probably break lots of version manager users, so it’s only really practical as a separate index file, which probably won’t be worth it since it’d be two sources of truth.

ljharb avatar Nov 22 '23 16:11 ljharb

😢😭😭

raphaellueckl avatar Nov 23 '23 14:11 raphaellueckl

@raphaellueckl I'm actually quite glad that it is this way, since on my machine the listing is instant and I don't have to scroll some 18 pages to get to the latest versions. But if you really prefer it in reverse order nvs seems to have it that way.

kuchta avatar Nov 24 '23 12:11 kuchta

You can get this by nvm ls-remote | tac, for example (or a workaround if tac isn't present on your system).

For the reasons described above, I don't think this is something nvm should worry about.

ljharb avatar Jul 29 '24 00:07 ljharb

@ljharb It's not the same, since your command has to wait for the completion to show anything...

kuchta avatar Jul 29 '24 13:07 kuchta

@kuchta because of the ordering in the source data, that’s impossible to avoid, for nvm or for users.

ljharb avatar Jul 29 '24 14:07 ljharb

@ljharb I don't know from where the source data come from, but I'm quite sure it can be improved by first class support in the command, since getting even few thousands lines could be get in a blink of an eye...

kuchta avatar Jul 30 '24 09:07 kuchta

@kuchta nvm ls-remote | tac works super fast for me, so i doubt it can be improved in the tool. The source data is https://nodejs.org/dist/index.tab

ljharb avatar Jul 30 '24 17:07 ljharb