npm、yarn设置源
介绍一款能同时、分开管理npm、yarn源的工具
cgr -- change registry | yarn & npm registry manager
npm github
安装
npm install -g cgr
默认源列表:N代表npm,Y代表yarn,代表npm和yarn共用的源*
cgr ls N npm ---- https://registry.npmjs.org/ cnpm --- http://r.cnpmjs.org/ Y taobao - https://registry.npm.taobao.org/ yarn --- https://registry.yarnpkg.com/
源切换: y/yarn代表yarn切换,n/npm代表npm切换,大小写均可;type为空,表示同时切换源
cgr use cnpm npm registry has been set to: http://r.cnpmjs.org/ yarn registry has been set to: http://r.cnpmjs.org/ cgr use cnpm y yarn registry has been set to: http://r.cnpmjs.org/ cgr use cnpm n npm registry has been set to: http://r.cnpmjs.org/
添加私有源
cgr add test http://registry.private.com add registry test success cgr ls N npm ---- https://registry.npmjs.org/ cnpm --- http://r.cnpmjs.org/ Y taobao - https://registry.npm.taobao.org/ yarn --- https://registry.yarnpkg.com/ test --- http://registry.private.com/
删除私有源
cgr del test delete registry test success
源响应时间测试
cgr test N npm ---- 693ms cnpm --- 223ms Y taobao - 102ms yarn --- 929ms
说明
cgr 是基于nrm的改进版本,进行了一些优化,能同时管理npm、yarn源。底层通过bash命令进行源切换操作,避免了直接操作.yarnrc等源管理文件。
相关推荐
yegen00 2020-10-21
Notzuonotdied 2020-09-17
hline 2020-07-29
tomli 2020-07-26
xieting 2020-07-04
YarnSup 2020-06-28
flyingbird 2020-06-14
Notzuonotdied 2020-06-13
xieting 2020-05-29
tomli 2020-05-27
xieting 2020-05-26
tomli 2020-05-25
tomli 2020-05-11