Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/leon406/cdn.js

静态CDN资源失效自动切换
https://github.com/leon406/cdn.js

autoswitch cdn

Last synced: about 2 months ago
JSON representation

静态CDN资源失效自动切换

Awesome Lists containing this project

README

        

# 静态CDN资源失效自动切换

## **:warning: 此库作为本地资源加载,不要用cdn加载**

## 使用方式

```javascript

...


<!-- You should specify the package, version,ile, and your local resource path -->
loadCdnResource("jquery", "3.6.3", "jquery.min.js", "local.js", 2000)
<!-- and also can custom total CDN check timeout for quick response -->
loadCdnResource("jquery", "3.6.3333", "jquery.min.js", "local.js", 2000)

...

```

备选服务方式,有默认cdn, 仅在CDN服务宕机后重新加载

```javascript

...



!window.jQuery&&loadCdnResource("jquery", "3.6.3", "jquery.min.js", "local.js")

...

```

## CDN

### 国内CDN

- [七牛云](https://www.staticfile.org/)
- [360 75CDN](https://cdn.baomitu.com/)
- [饿了吗](https://npm.elemecdn.com)
- [知乎](https://unpkg.zhimg.com)
- [CDNBee](https://www.beecdn.com/)
- [BootCDN](http://www.bootcdn.cn/)
- [loli](https://cdnjs.loli.net/)
- [字节](http://cdn.bytedance.com/)

### 国外CDN

- [CDNJS](https://cdnjs.com/) :star:
- [jsDelivr](http://www.jsdelivr.com/)
- [unpkg](https://unpkg.com/)