yrm是一个yarn的源管理器,可以快速的在yarn的各个源之间切换,方便快捷。
安装:
npm install -g yrm
// or
yarn global add yrm
列出可用源,*是当前源
yrm ls
npm ---- https://registry.npmjs.org/
cnpm --- http://r.cnpmjs.org/
* taobao - https://registry.npm.taobao.org/
nj ----- https://registry.nodejitsu.com/
rednpm - http://registry.mirror.cqupt.edu.cn/
npmMirror https://skimdb.npmjs.com/registry/
edunpm - http://registry.enpmjs.org/
yarn --- https://registry.yarnpkg.com
添加源
yrm add baidu https://registry.npm.baidu.com
删除源
yrm del baidu
切换源
yrm use baidu
npm ---- https://registry.npmjs.org/
cnpm --- http://r.cnpmjs.org/
taobao - https://registry.npm.taobao.org/
nj ----- https://registry.nodejitsu.com/
rednpm - http://registry.mirror.cqupt.edu.cn/
npmMirror https://skimdb.npmjs.com/registry/
edunpm - http://registry.enpmjs.org/
yarn --- https://registry.yarnpkg.com
* baidu --- https://registry.yarnpkg.com
测试源的速度
yrm test
npm ---- 4381ms
* cnpm --- 2050ms
taobao - 1440ms
nj ----- Fetch Error
rednpm - Fetch Error
npmMirror 13988ms
edunpm - Fetch Error
yarn --- Fetch Error
。