背景

目前国内有很多 NPM 的 CDN,可以高速支持相关包文件的访问下载,如:

但这些 CDN 并不全,很多 NPM 上的包 在这些 CDN 上是找不到的。原因是,它们都是从 CDNJS 上同步的数据,CDNJS 并不会把所有的 NPM 包进行同步,所以当你需要的一些 NPM 包没有在 CDNJS 上面,你就用不了上面这些国内 CDN 了。

CDN NPM资源

【Web缓存网】

https://npm.webcache.cn/:package@:version/:file

【unpkg自建】

https://cdn.cbd.int/:package@:version/:file

【饿了么】

https://npm.elemecdn.com/:package@:version/:file
https://github.elemecdn.com/:package@:version/:file

【知乎】

https://unpkg.zhimg.com/:package@:version/:file

【渺软公益 CDN】

https://npm.onmicrosoft.cn/:package@:version/:file

【JSDMirror】

https://cdn.jsdmirror.com/npm/:package@:version/:file

【jsDelivr(慢)】

https://cdn.jsdelivr.net/npm/:package@:version/:file
https://fastly.jsdelivr.net/npm/:package@:version/:file

【crazywong】

https://file.crazywong.com/npm/:package@:version/:file

CDN GitHub资源

【Web缓存网】

https://code.webcache.cn/gh/:user/:repo@:version/:file

【渺软公益 CDN】

https://jsd.onmicrosoft.cn/gh/:user/:repo@:version

【crazywong】

https://jsd.012700.xyz/gh/:user/:repo@:version

【JSDMirror】

https://cdn.jsdmirror.com/gh/:user/:repo@:version

【jsDelivr(慢)】

https://cdn.jsdelivr.net/gh/:user/:repo@:version
https://fastly.jsdelivr.net/gh/:user/:repo@:version