Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programmatically get the latest Google Hosted library version

Tags:

cdn

google-cdn

Is there a way to programmatically get the latest version of a Google hosted library?

The reason why I'm asking this is to use it in a template generator. IMHO, it's good to download latest library at the time the template is being applied to the project and it's slightly annoying having to update the repo just because the library released a new version.

Don't get me wrong, this isn't meant to always use the latest while your app is working. It's meant to always give you the latest version available at the time of coming up with your project.

like image 687
Darío Javier Cravero Avatar asked Aug 14 '26 14:08

Darío Javier Cravero


2 Answers

If you use cdnjs: http://cdnjs.com/packages.json

Also available via HTTPS: https://cdnjs.com/packages.json

like image 193
Ryan Kirkman Avatar answered Aug 17 '26 04:08

Ryan Kirkman


I couldn't find a suitable solution so I went out there and built one. Would you give CDN.io a go and share your thoughts?

Objective? Always have the latest reference to a CDN hosted library, programatically.

Why could this be useful? I.e., to be used in template generators. In that way we can always rest assured that the user will get the latest version of their CDNed library and we don't have to worry about updating helpers anymore.

Why did I even bother? Because CDN services don't offer an API to access their list of hosted libraries!

What if you don't want to use the Web Service? No problem, just use it as a library.

like image 41
Darío Javier Cravero Avatar answered Aug 17 '26 03:08

Darío Javier Cravero



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!