-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Added latest.json file that contains the latest versions #342
Conversation
Have you seen the |
I have not seen it but: https://nodejs.org/download/release/index.json does not contain (precomputed) the latest tagged versions which makes it hard for bash scripts and other non-node code |
390a434
to
c718ea4
Compare
I changed the PR to underline my point better: The |
Could we extract the logic related to latest versions into its own npm package? Or maybe a new method on node-version-data @rvagg? I'm really hesitant turning our internal data model, used by our templates, into a .json file that others around the world could depend on. We should be able to completely refactor our internal data model whenever we want, without worrying about breaking things for other users and projects. |
It is important to me that the nodejs homepage (and community) decides what constitutes "stable" and "lts". The way - the authority - on how it is decided atm is specified in the latestversion.js. If |
Absolutely agree with you! Sorry for not being explicit earlier, but we would ofc throw our nodejs.org dont benefit from having custom logic related to resolving LTS and Stable, we just haven't seen the need to publicly expose it, until now with this PR. On the other hand we have our internal data model in the |
Can you please point out what is actually missing there? |
@thefourtheye https://nodejs.org/download/release/index.json does not contain a clear flag or identifier for the latest Just to clarify again: It can be "computed" quite easily but at the moment A) it has to be computed, which takes time and coding effort and B) it doesn't allow us to freely specify what we think is the latest lts or stable release. Also: The release/index.json is quite large (and will presumably grow in future) which costs bandwidth and download speed |
@martinheidegger would extracting the logic into a new or existing npm package as I have described, suffice at first? |
There are plenty of ways that would "suffice" but none of them is even closely as straight-forward as this one. |
Alright... I do appreciate you raising this issue, I'm sure there are lost of other devs that would appreciate an easy way to resolve current LTS/Stable versions. On the other side I would appreciate if we could keep this constructive to find the best solution for all of us. What if |
Would be fine to me. |
-1 from me here and in the related issue in build:
|
@rvagg I respect your opinion a lot (my first instinct was to just close this PR), but let me address your arguments one by one:
Background: I made this pull request as preparation for a tool that checks whether-or-not the latest version of node is installed on computers. If such a tool becomes main-stream this API very possibly might be called a lot more often than currently the |
@martinheidegger I edited the text to include bullets. Hope that is okay :-) |
@thefourtheye thx |
For me this boils down to:
Adding new api's should be done with care. Am also |
also fwiw @martinheidegger there is an index.tab as well, I use that exclusively for non-Node code that needs to fetch this, e.g. I get the latest version with: latest=$(curl -sL https://nodejs.org/download/release/index.tab | \
awk '{ if (!f && NR > 1) { print $1; f = 1 } }') you could do the same but for only LTS since it's a column in there latestLTS=$(curl -sL https://nodejs.org/download/release/index.tab | \
awk '{ if (!f && NR > 1 && $10 != "-") { print $1; f = 1 } }') When there are multiple LTS' then you could just check for the version by name, e.g. latestArgon=$(curl -sL https://nodejs.org/download/release/index.tab | \
awk '{ if (!f && NR > 1 && $10 == "Argon") { print $1; f = 1 } }') |
As exposing |
@martinheidegger What about @phillipj's suggestion? Would that be helpful? Is the change still needed or can we close this PR? |
Sorry for not having answered to to that issue. node-version-data works but is pretty slow here and not really much fun. I wouldn't use or trust a module that does it and just rely one one-data-source of truth. As such I will have to learn to live with node-version-data. Note: I closed the issue because I don't have the time or energy to invest in this. Feel free to reopen |
I didn't find a good way to figure out programmatically what the latest version of node.js is. So it thought it might be good to be able to have it directly on the nodejs homepage as a json file that people can parse to see what the latest versions/lts versions are. In case some writes a nice cli tool like
n
ornvm