Comments (8)
Will get back to you with a more thorough answer, in the mean time there is
already a Sublime 2 cdnjs package you can check out.
On Thu, Sep 13, 2012 at 8:26 AM, Jannis Gundermann <[email protected]
wrote:
I'm using Sublime Text 2 and the Nettuts Fetch plugin which can fetch
resources via a URL, at the moment trying to get the latest version of
Modernizr proves difficult as there doesn't seem to be a single URL that
would auto server the 'latest' version of this script…Currently I'm querying the url: "
http://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.1/modernizr.min.js"directly but the moment
2.6.2 comes out I will still be referencing 2.6.1.Is there a better way to grab the "latest" of a given library?
Something like: "
http://cdnjs.cloudflare.com/ajax/libs/modernizr/latest/modernizr.min.js"where the latest folder would always contain the most up to date version of
that lib would be nice.Any thoughts on this or a better way for me to do what I'd like to do here?
Thanks for reading.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/423.
from cdnjs.
Thanks for the reply Thomas.
I've installed the cdnjs package but noticed that it only adds a script
tag with the properly set src
attribute to the chosen library file.
While this is nice, I would like to access the contents of said script so that I can quickly dump the entire script (not just a link/reference to the script) into a local file.
Look forward to your reply.
from cdnjs.
I think this would be very useful. latest
might be asking for trouble though. How about supporting URLs like
/ajax/libs/library_name/2.6.x
- latest 2.6/ajax/libs/library_name/2.x.x
- latest 2.x/ajax/libs/library_name/x.x.x
- latest
For libraries that use semver, this should work pretty well.
from cdnjs.
The latest
was more for explaining my point than suggesting that it was the best solution, @pwnall's does seem much nicer though as it would allow the locking of a major version which could be very handy.
from cdnjs.
I think it would be good to do things Google style, e.g.
http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js
http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js
Notice you can have the latest major, minor or specific version. The nice thing about this strategy is it doesn't make assumptions about semantic versioning, e.g.
http://ajax.googleapis.com/ajax/libs/prototype/1/prototype.js
http://ajax.googleapis.com/ajax/libs/prototype/1.7/prototype.js
http://ajax.googleapis.com/ajax/libs/prototype/1.7.1/prototype.js
http://ajax.googleapis.com/ajax/libs/prototype/1.7.1.0/prototype.js
I'll begin investigating possibilities for achieving this.
from cdnjs.
That would be my preferred url syntax too.
Thanks @ryankirkman for looking into this.
from cdnjs.
@jannisg @ryankirkman because we are running a server for the stats now, we could throw an API on there that could handle this situation.
Would add network request so wouldn't be fantastic for serving files on website.
Or we could throw into the build process a script that copies the latest version into a latest.js file next to package.json...
from cdnjs.
Closing this issue for more information visit #360
from cdnjs.
Related Issues (20)
- Refused to load the script 'https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.js' HOT 1
- I don't understand HOT 1
- amis库缺少必要的文件 HOT 1
- git-sync is failing HOT 11
- Sponsoring your project HOT 6
- how to add files to cdnjs, or some aplication like cdns can upload javascript file HOT 1
- Fonts from "primevue" library not in the cdnjs distribution HOT 4
- Some versions of devextreme are missed HOT 9
- Loading Files Issue (Egypt) HOT 2
- Sponsoring HOT 1
- DevExtreme 23.1.3: missing *.js files HOT 1
- SRI hashes changed on multiple libraries yesterday and some SRI hashes are wrong HOT 30
- https://cdnjs.cloudflare.com/ajax/libs/moment-timezone/0.5.34/moment-timezone-with-data.min.js 404 / missing HOT 9
- Some versions of hexo-theme-anzhiyu are missing HOT 3
- SRI hash for moment.js/2.29.4 does not match HOT 3
- cd pentmenu
- How to set the Video Autoplay? HOT 1
- Advertising HOT 2
- cdnjsdl HOT 2
- CDN公共库 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cdnjs.