I’m trying to change a github script
into a raw script with jsdelivr.
If you look at this picture I took:
they want me to state the version of my repo. What do they mean by this?
They said I could load any github release, commit, or branch.
Can you please kindly tell me how to be able to get my file as a link of jsdelivr?
Thanks.
Hello!
I believe you can use the repository name and commit id, like this:
https://cdn.jsdelivr.net/gh/skaparate/fcc-pomodoro-clock-react@f24a93f7d92fa29ef393d7f103d9015d61cd11fd/README.md
Hope it helps
!
Thanks, but how to you get the id?
That’s easy 
- Go to GitHub and find your repository. In the previous example, my repository was
https://github.com/skaparate/fcc-pomodoro-clock-react
.
-
Below the download/clone button, there is a text that says latest commit hex_string on Dec 8, 2019. If you copy the link location (right button click over the hex_string -> copy link location) and paste it on the notepad (for example), you will see a longer number at the end; that’s the commit id.
For example, the latest commit of my example is https://github.com/skaparate/fcc-pomodoro-clock-react/commit/f24a93f7d92fa29ef393d7f103d9015d61cd11fd
, the id being f24a93f7d92fa29ef393d7f103d9015d61cd11fd.
Of course, that’s one way of getting it. You could also use the console command git log
to get a list of commits or limiting it by one commit git log -n 1
which would output the latest commit.
Another, easier, way should be to specify the branch you want, which automatically should use the latest commit: https://cdn.jsdelivr.net/gh/skaparate/fcc-pomodoro-clock-react@master/README.md
1 Like
Thanks you so much for your help. I was searching how to do this for FOREVER.
1 Like
If you’re go to the NPM or GitHub page for the library you want, they both have a list of versions (should be under releases
tab in GitHub, will be under versions
tab on NPM). On command-line npm view some-package versions
.
2 Likes