Skip to content

Instantly share code, notes, and snippets.

@MattIPv4
Created June 14, 2020 19:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MattIPv4/453e365bcc7498157363f832af75a819 to your computer and use it in GitHub Desktop.
Save MattIPv4/453e365bcc7498157363f832af75a819 to your computer and use it in GitHub Desktop.

Cloning specific folders of cdnjs

Due to the amount of libraries of cdnjs, the repository has a very big size. Because of this some might find it difficult or time and resource consuming to carry out normal git tasks, such as cloning and commiting.

This page is a guide to cloning only some folders of cdnjs using a sparse checkout.

  1. If you haven't already, fork cdnjs on GitHub, so you can push commits on your fork.
  2. Open a terminal in your computer (with git installed)
  3. Run git init cdnjs
  4. cd cdnjs
  5. git remote add -f origin https://github.com/YOURUSERNAME/cdnjs.git
  6. git config core.sparsecheckout true
  7. Add the folders you'd like to download in .git/info/sparse-checkout:
  • echo "ajax/libs/library-name/" >> .git/info/sparse-checkout
  • echo "ajax/libs/another-one/" >> .git/info/sparse-checkout
  1. git pull origin master

Now you can make your changes / add a new library. Make sure that the folder you are working on has been included in step 7, or it will be ignored in commits.

Source: http://stackoverflow.com/a/13738951/3077735

Extensions, Plugins, Resources

Developers

If you wish to get a list of all the packages you can get the .json from http://cdnjs.com/packages.json

To generate a link from the package.json file use the template http(s)://cdnjs.cloudflare.com/ajax/libs/{name}/{version}/{filename}

Community Plugins

Sublime Text

Version.js

Test a different script version with the switch of a query string.

CDNJS for WordPress

cdnjs command - Gem

CDN.io

CDN.io is there to always give you get the latest version of hosted JavaScript libraries on public CDNs

cdnjs Mvc Helper

An ASP.net MVC3 web helper for loading scripts from http://cdnjs.com.

cdnjs-cli

A command line interface to search/install Javascript/CSS libraries from http://cdnjs.com

AssetHat

Load CSS and JS faster in Rails. Your assets are covered.

gimme assets

gimme is a little, experimental tool to manage web assets from the CLI.

fetch.js

Fetchjs makes it trivial to download and setup the latest versions of client side libraries.

cmbn

Generate and serve combo URLs across various CDNs and other public servers

cdnjs.el

A front end for http://cdnjs.com for Emacs

gocdnjs

Command line interface for http://cdnjs.com written in Go

Javascript Injector

This extension injects any JS library from CDNJS.com into a page.

JSKit (Chrome Extension)

This extension loads any JS or CSS file directly into your open tab. You can manually enter the URL of the file, or use one of the libraries provided by CDNJS.com, which will be automatically listed.

cdnjs-client

A minimalistic bower-like tool for managing web resources relying mainly on Cdnjs. Used on Arch Linux, Git Bash and Babun/Cygwin. Depends on jq, bash and curl.

cdnjs-ext

cdnjs-ext is a Chrome extension that allows you to interact with cdnjs in a quick and simple way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment