REST API for dl.nwjs.io
If there was a REST route to call that would return a JSON payload of NW.js releases, one could create dynamic code on the website to always point to the correct latest release.
@TheJaredWilcurt We now have a simple list of latest & stable versions at http://nwjs.io/versions.json.
@ghostoy I've been using that for years but recently found that it would be nice to be able to pull in these versions via npm.
There are repos like node-abi that have hard-coded the NW.js versions into them, and are several years out of date.
Currently the only way to have access to these up-to-date NW.js versions via npm is to do:
npm install --save-dev bower nwjs/website#master
then
const nwVersions = require('nw-version/src/versions.json');
Which installs a ton of unwanted things (node-sass binary is built, coffeescript, react, bower, etc) just to have access to one JSON file.
Suggested Solution:
- Create a new repo
nwjs/nw-versions - Move the
versions.jsonto that repo - Publish the repo to
npmso people can just usenpm install nw-versions - Update the website to use this new repo as well, pointing to
"nw-versions": "latest"so all builds will still be the same
If you do step 1 and 3, then I'll do step 2 and 4.
Step 2 done:
- https://github.com/TheJaredWilcurt/nw-versions
If you create the nwjs/nw-versions repo, then I'll submit a PR against it for the above content.
Then you or @rogerwang can merge it and do the npm publish