Skip to content

Guide · Open source

How to use cdnjs: load free libraries and find the files

Updated · written with AI from the project's own documentation and checked against our catalogue data

cdnjs is a free public content delivery network that serves popular front-end libraries such as JavaScript, CSS and font files from a shared host. This guide explains what the cdnjs/cdnjs GitHub repository contains, why it no longer receives updates, and how web developers and mirror operators should work with the project today. After reading, you will know where cdnjs files now live, which repository holds the library definitions, and when another CDN may suit you better.

cdnjscdnjs/cdnjs · ★ 10.7k · MIT

Quick start

  1. 1Read the no-longer-updated notice. Confirm that the cdnjs/cdnjs repository is archived for updates and that storage now lives in a Cloudflare R2 bucket.
  2. 2Clone the repository if you need it. Run git clone https://github.com/cdnjs/cdnjs to copy the repository to your machine.
  3. 3Look up library definitions. Open the cdnjs/packages repository for the JSON files that control the libraries cdnjs hosts.
  4. 4Check the license of each library. Each library is released under its own license, separate from the MIT license on the repository.
  5. 5Request mirror access if needed. Mirror operators can open a mirror request issue to ask for read-only R2 credentials.

What is cdnjs and who is it for?

cdnjs is a free, open source CDN. Developers use it to load common front-end libraries from a fast shared host instead of hosting those files on their own server.

The cdnjs/cdnjs repository holds the actual asset files (JavaScript, CSS and fonts) for libraries served by cdnjs. It is the storage side of the project, not the place to browse library definitions.

  • Web developers who want to load common libraries from a free public CDN
  • Operators running a cdnjs mirror who need to know where files now live
  • People who want to understand how the cdnjs project is split across repositories

Important: this repository is no longer updated

The README warns that this repository is no longer updated because it became too large. cdnjs has moved its storage to a Cloudflare R2 bucket as part of its migration to Cloudflare's Developer Platform, so new files will not appear here.

If you are not sure whether a file you need is current, check the live cdnjs site rather than this repository.

Get the repository with git clone

The README's install instruction is a single git clone command. The source does not list any prerequisites for it. Run it in the folder where you want the repository stored.

Keep in mind that the repository is large and no longer receives new files, so the clone is mainly useful for reference or for mirror work.

git clone https://github.com/cdnjs/cdnjs

Find the library definitions in the packages repository

The JSON files that control which libraries cdnjs hosts live in a separate repository, cdnjs/packages. The README points there for library definitions, and also for contributing.

Other related repositories are listed in the README: cdnjs/static-website for the website, cdnjs/api-server for the API, cdnjs/brand for branding and guidelines, and cdnjs/cf-stats for monthly CDN stats and usage reports.

  • cdnjs/packages: JSON library definitions and contribution point
  • cdnjs/static-website: the cdnjs website
  • cdnjs/api-server: the cdnjs API
  • cdnjs/brand: branding and brand guidelines
  • cdnjs/cf-stats: monthly CDN stats and usage reports

If you run a cdnjs mirror

The README says that if you operate a mirror and relied on this repository for syncing, you should open an issue on the cdnjs GitHub repository to request read-only S3 (R2) credentials for the cdnjs R2 bucket. The issue template is labelled as a mirror request.

Each library is released under its own license. The cdnjs repository itself is published under the MIT license, so check each library's license before reuse.

Contributing and what is not accepted

The README states that pull requests are no longer accepted in this repository because it is considered robot-only. To contribute to cdnjs, use the cdnjs/packages repository or the other open-source repositories under the cdnjs GitHub organisation.

What people use it for

  • Loading a common front-end library from a free public CDN in a web page
  • Finding out where cdnjs assets are stored after the move to Cloudflare R2
  • Locating the packages repository to see how libraries are defined
  • Requesting read-only R2 access to sync a cdnjs mirror

Frequently asked questions

Is cdnjs free to use?

The cdnjs repository is published under the MIT license, and the README describes cdnjs as a free and open source CDN. Each individual library is released under its own license, so check that before you reuse a file.

Is cdnjs still updated?

The README says this repository is no longer updated because it became too large. cdnjs is now powered by a Cloudflare R2 bucket after its migration to Cloudflare's Developer Platform.

Where do I find the list of libraries cdnjs hosts?

The JSON files that control the hosted libraries are in the cdnjs/packages repository, according to the README. This repository holds the asset files themselves.

Can I contribute code to cdnjs/cdnjs?

No. The README says pull requests are no longer accepted in this repository because it is considered robot-only. Contributors should look at the cdnjs/packages repository instead.

How do I run a cdnjs mirror?

The README asks mirror operators who relied on this repository for syncing to open an issue requesting read-only S3 credentials for the cdnjs R2 bucket. The source does not describe the rest of the mirror setup.

What are the alternatives to cdnjs?

The source names jsDelivr, unpkg and Google Hosted Libraries as comparable projects. It does not rank them, so compare the libraries you need on each before choosing.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

cdnjs suits web developers who want common front-end libraries from a free public CDN, and mirror operators who need to know where files now live. It is a poor choice for anyone wanting to contribute code to this repository or expecting new files here, since the README says both are no longer supported. For a CDN that is still in active use for new files, compare jsDelivr, unpkg and Google Hosted Libraries.

Install options & downloads